Ubuntu – revert to an older version of a package
If you just try to install an older version of a package that you already have installed you most likely will be unable to do so without having to make some tweaks. In this case, normally aptitude will complain with a message that you already have the latest version of the package.
There is a way to get around this problem. To do so, create a file called preferences in /etc/apt. The file should contain 3 lines per each package that you want to revet to an older version. These 3 lines need to specify the package name, the version that you would like to “pin” and the priority. For example, if I wanted to revert the package libbz2-1.0_1.0.5-0.1_i386.deb to libbz2-1.0_1.0.4-2ubuntu4_i386.deb, I would put the following in the preferences file:
Package: libbz2
Pin: version 1.0_1.0.4-2
Pin-Priority: 1001
Note, that the Pin-Priority has to be over 1000 if you are going back to an older version of a package.
After I am done with this, all I have to do is execute sudo apt-get install libbz2 and I will get the older version installed.
Keep in mind that this package version will be “pinned” and no future updates to that package will be picked up by the update manager. For further information on this subject look at the man pages for apt_preferences.
5 Comments to Ubuntu – revert to an older version of a package
Leave a comment
Search
Archive
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Mar | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 | |||
Recent Comments
- Aron on Clone Disk Drives with Ubuntu. Make an Exact Copy of Your Hard Drive.
- letroll on Android – Displaying Dialogs From Background Threads
- When Wireless Goes Rogue « Ham Radio Weblog PD0AC on KARMA on the Fon and Sniffing Wireless Network Traffic with Ubuntu – Step by Step
- jornando junior on Android – Displaying Dialogs From Background Threads
- Geo on Extract Audio (.mp3) from Video Files Like .flv, .mov, .avi and Others with Ubuntu
Categories
Blogroll
Online Tools
Other
BLOG ARCHIVE
- March 2012 (1)
- November 2011 (1)
- August 2011 (1)
- April 2011 (1)
- January 2011 (2)
- September 2010 (1)
- August 2010 (2)
- July 2010 (2)
- June 2010 (2)
- May 2010 (1)
- January 2010 (2)
- December 2009 (2)
- November 2009 (3)
- October 2009 (1)
- September 2009 (3)
- July 2009 (1)
- May 2009 (1)
- March 2009 (1)
- February 2009 (2)
- January 2009 (2)
- December 2008 (1)
- November 2008 (4)
- October 2008 (5)
Nice tip. It helps me a lot.
Thanks man!
[...] ???http://dimitar.me/ubuntu-revert-to-an-older-version-of-a-package/ [...]
Thanks for the great info!
After I added the info to preferences, and ran “sudo apt-get update” it still showed the newer version in synaptic. Am I missing something?
Thanks again
@ Richard,
Make sure that the info in the preferences file is correct and has the older version number specified. Also, the priority needs to be high (above 1000).
If all the info is correct then when you do sudo apt-get install package_name it should go back to the specified version in the preferences file.
I tried everything as you said but it didn’t work
I downloaded old version of package from packages.ubuntu.com and installed manually