Ubuntu: apt-cache does not show older versions of a package



Question:

I need to downgrade jenkins from 2.54 to 2.53. Repo is set up as follows:

$ cat /etc/apt/sources.list.d/jenkins.list  deb http://pkg.jenkins-ci.org/debian binary/  

The repo contains version 2.53 so I try to install it like so:

$ sudo apt-get install jenkins=2.53  Reading package lists... Done  Building dependency tree  Reading state information... Done  E: Version '2.53' for 'jenkins' was not found  

OK, let's check policy:

$ apt-cache policy jenkins  jenkins:    Installed: 2.54    Candidate: 2.54    Version table:   *** 2.54 0          500 http://pkg.jenkins-ci.org/debian/ binary/ Packages          100 /var/lib/dpkg/status  

No. How about madison?

$ apt-cache madison jenkins     jenkins |       2.54 | http://pkg.jenkins-ci.org/debian/ binary/ Packages  

That's a no too.

How do I get that version into the cache so that I can install it? I'm a Red Hat guy, new to apt :(

EDIT:

$ sudo apt-get update  Ign http://us-east-1.ec2.archive.ubuntu.com trusty InRelease  ...  Hit http://pkg.jenkins-ci.org binary/ Packages  Hit http://security.ubuntu.com trusty-security InRelease  Ign http://pkg.jenkins-ci.org binary/ Translation-en_US  Ign http://pkg.jenkins-ci.org binary/ Translation-en  ...  

this shows only the latest version of the package:

$ aptitude versions jenkins  

Still no:

$ sudo apt-get install jenkins=2.53  Reading package lists... Done  Building dependency tree  Reading state information... Done  E: Version '2.53' for 'jenkins' was not found  


Solution:1

If you have a look at this file:

less /var/lib/apt/lists/pkg.jenkins.io_debian_binary_Packages  

You will see the only version provided for your chosen distro is 2.54, actually apt-cache data comes from here too.

And as you already seen, other versions are available in form of .deb format as their descriptions stats:

If you need *.deb for a specific version, use these.

grab you specific versions deb file, use gdebi or dpkg -i to install it.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »