8

I did an upgrade of Ubuntu from 12.04 to 14.04 and was surprised to discover that my earlier installed and configured jenkins is broken. To add to the misery, if I do an apt-get install jenkins or apt-cache search jenkins. I do not see either jenkins or jenkins-cli or jenkins-common.

If I do an apt-get install jenkins, I get the error:

buildman@pluto:~$ sudo apt-get install jenkins
Reading package lists... Done
Building dependency tree       
Reading state information... Done
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

My OS details:

buildman@pluto:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty

Any pointers on how to get out of the mess (that I created) would be of great help.

Pandya
  • 34,843
  • 42
  • 126
  • 186
Sandeep
  • 183
  • 1
  • 1
  • 5

2 Answers2

7

Jenkins was removed from the official Ubuntu repositories in Trusty. The reasoning was given in https://bugs.launchpad.net/ubuntu/+source/jenkins/+bug/1294005, but the short version is that it's more secure and easier to keep up-to-date if you use the upstream repository from now on. Details on how to do that are available at https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu

lazyreader
  • 90
  • 4
  • 1
    Note that you might have to run `apt-get remove jenkins jenkins-common` in order for your install from the new repository to work. Ubuntu structures the Jenkins `.deb` differently. And back _everything_ up! – lazyreader Sep 08 '14 at 15:56
  • I didn't get it. I looked at Jenkins wiki page, but there is no info about how to install in on Ubuntu 18. I tried to add 'universe' apt repository, but nothing changed – Alexander Kuzin Jul 07 '20 at 09:57
  • You need to add the jenkins repository, not a new ubuntu source, as detailed in the second link. – lazyreader Jul 20 '20 at 21:25
5

installing jenikin

wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -

sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'

sudo apt-get update

sudo apt-get install jenkins

http://localhost:8080

sudo cat /var/lib/jenkins/secrets/initialAdminPassword (to get admin password)

sudo apt-get update

sudo apt-get install jenkins

you can skip last two lines but I followed that way

subhashis
  • 151
  • 1
  • 3