Install Jenkins Server

Hi all,

I am new to Jenkins and I have encountered some issues with the task to install Jenkins. I have followed several tutorials/Ubuntu installation manuals online, all of which fail ti install Jenkins on the Jenkins server:

Here are the steps that I have taken so far:

# From Jump Server
ssh root@jenkins      S3curePass
cat /etc/*release  //Ubuntu 16.04

# Install Java
apt update
apt search openjdk
apt install openjdk-8-dbg
java -version

# add the key 
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sh -c 'echo deb https://pkg.jenkins.io/debian binary/ > \
    /etc/apt/sources.list.d/jenkins.list'

apt update
apt install jenkins // error...see below
# Package jenkins is not available, but is referred to by another package.
# This may mean that the package is missing, has been obsoleted, or
# is only available from another source
# E: Package 'jenkins' has no installation candidate

# Solution ?? => https://www.blackmoreops.com/2014/12/13/fixing-error-package-packagename-not-available-referred-another-package-may-mean-package-missing-obsoleted-available-another-source-e-pa/

apt update && apt upgrade -y && apt dist-upgrade -y && apt install jenkins

# Package 'jenkins' has no installation candidate
# E: The method driver /usr/lib/apt/methods/https could not be found.
# N: Is the package apt-transport-https installed?
# E: Failed to fetch https://pkg.jenkins.io/debian/binary/InRelease
# E: Some index files failed to download. They have been ignored, or old ones used instead.

apt install apt-transport-https
systemctl status jenkins 
# Failed to connect to bus: No such file or directory
apt list --installed | grep jenkins //not listed

I am at a loss on what to do or where to look for a solution.

Thanks in advance to anyone who can help!!

Hi, I’m a newbie like you but perhaps this will help:
add a line in your /etc/apt/sources.list
deb Debian Jenkins Packages binary/
This was mentioned at Debian Jenkins Packages
I hope you get it!

1 Like

Hello, @juliettet
Did you try service jenkins start?

1 Like

sudo commend i snot working for this task. is anything i am missing here?

1 Like

1 apt-get update
2 apt install python-software-properties
3 apt install openjdk-8-jdk
4 wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
5 sudo sh -c ‘echo deb Debian Jenkins Packages binary/ >
/etc/apt/sources.list.d/jenkins.list’
6 apt install apt-transport-https
7 apt update
8 apt install jenkins
9 sudo service jenkins start

2 Likes

Hi @andrewn2021,

Thank you for responding. I tried that and all I get are errors in return:

N: Is the package apt-transport-https installed?
E: Failed to fetch https://pkg.jenkins.io/debian/binary/InRelease  
E: Some index files failed to download. They have been ignored, or old ones used instead.
root@jenkins:~# apt-get install jenkins
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package jenkins

PS. …see @tgp 's post if you’re curious. That helped a lot.

Hi @selvag,

I’ve been using either sudo su - or ssh root@jenkins.

1 Like

Hi @player001,

Thanks for responding:-)

I haven’t been able to get the package installed at all.

Hi @tgp,

Thank you for this. I am on the right track now with these steps (minus the sudo command):

 ssh root@jenkins      S3curePass
 apt-get update
 apt install python-software-properties
 apt install openjdk-8-jdk
 wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
 sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
/etc/apt/sources.list.d/jenkins.list'
 apt install apt-transport-https
 apt update
 apt install jenkins
 service jenkins start
 service jenkins status

 # go to host 1 => 8081
 cat /var/log/jenkins/jenkins.log  //get default password
 # install plugins + create admin user w/ credentials

All of the errors that I was getting are gone now. Yay!!

I was initially confused/unsure as to what/which binary (ie., stable vs debian-stable) to add to /etc/apt/sources.list.d/jenkins.list, so that that one of the steps that was tripping me up.

The other step that I had not seen mentioned in any of the tutorials that I had come across is apt install python-software-properties. Why is this step needed? …just curious.

Thanks a lot for your help!!

PS.

Unfortunately, I STILL failed the task. It says that I have the wrong username/password set up…even though I have copy/pasted the username/password directly from the lab portal. …argh…

1 Like

python-software-properties is the software that provides an abstraction of the used apt repositories. It allows you to easily manage your distribution and independent software vendor software sources.

1 Like

@juliettet you might have copied wrong username or name… The name is case sensitive…

1 Like

Thank you for taking the time to explain that to me @tgp ! I did not know that.

Hmmm… I used the exact username as described in the instructions. As it turns out, my task has now been marked as pending (Failed: ..seems like you have set correct 'username' and 'password' on setup wizard - #6 by rahul456). Another student (Lionel Gurret) was/is also facing the same issue.

…see what happens when I screen record the task as I run through it again.

Cheers:-)

1 Like