unable to install/recover jenkins after upgrading from ubuntu 12.04 to 14.04

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.


Solution 1:

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

Solution 2:

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