Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Update Manager keeps packages at the latest version, but occasionally a new package version may not work as expected or properly. How to downgrade an installed package and lock it at a specific version to prevent it from being updated? How can I do this using GUI or using a Terminal?

share|improve this question

2 Answers 2

up vote 14 down vote accepted

In GUI - using Synaptic

The Ubuntu Software Center’s simplified interface doesn’t offer the option to downgrade packages. Synaptic, a more advanced graphical package manager interface that Ubuntu used to include, offers this option. To downgrade a package graphically, first install the Synaptic application:

Ubuntu Software Center

After you done this, open the Synaptic Package Manager from the Dash:

synaptis

Search for the package you want to install an older version of in Synaptic, select it, and use the Package > Force Version option:

Force version

Select the version you want to install and click Force Version. Synaptic will only show you versions available in your repositories:

Select version

Click the Apply button to apply your changes and install the older version of the package, assuming everything works properly.

Apply

After you downgrade the package, select it and use the Package > Lock Version option. If you don’t do this, Ubuntu will try to upgrade the installed package the next time you update your installed packages:

Lock version

In Terminal – using apt-get

You can install a specific version of a package with apt-get in the Terminal. First, determine the available versions you can install with the following command (use for packagename the name of the program that you want to downgrade):

apt-cache showpkg [packagename]

Next, run the apt-get install command and specify the package version you want to install (use for version the version number previously determined of the program that you want to downgrade):

sudo apt-get install [packagename]=[version]

After it’s installed, run the following command to hold your installed version, preventing the package manager from automatically updating it in the future:

sudo echo "[packagename] hold" | sudo dpkg --set-selections

Source: http://www.howtogeek.com/117929/how-to-downgrade-packages-on-ubuntu/

share|improve this answer
3  
if you based your answer on this site howtogeek.com/117929/how-to-downgrade-packages-on-ubuntu please provide source link. I don't think howtogeek will mind but they sure need the proper source link so they can get the credit. –  Luis Alvarado May 10 '13 at 21:52

Another possibility:

Lets find the archived package on http://packages.ubuntu.com/:

For example downgrading php5 :

Search:

enter image description here

Found an exact hit lets look at the package page for php5 :

enter image description here

We can see the different versions of Ubuntu releases here we are at trusty:

enter image description here

Lets switch to version that ran php (5.3) ... 12.04 (precise) for example:

enter image description here

download the tar.gz

enter image description here

And then extract the tar file and install it:

cd /path/to/download
tar -xzvf name_of_package
cd name_of_extracted_folder
./configure
make
sudo make install

Possible issues that one could run into when running ./configure:

  • Missing dependencies ( had to install libxm2-dev): enter image description here

Issues running make:

  • errors while compiling could include flags not being set properly, or issues with the code itself.
  • A bunch of garbage when compiling, and then some issue in the code?
  • In my case i had to find the up to date source files/tarball for php ( http://php.net/downloads.php )
  • and retry extraction and make
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.