Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to downgrade a package to an older version via apt-get?!

Another tools are also accepted but apt-get is preferred.

share|improve this question

If you have the version number, or the target release, apt-get supports choosing a particular version or target release. More details can be found on manual page of apt-get. It can also be accessed from terminal by typing man apt-get

sudo apt-get install <package-name>=<package-version-number> OR

sudo apt-get -t=<target release> install <package-name>

is the command to be run. This can be used to down-grade a package to a specific version.

It has been helpfully pointed out in the comments that

  • apt-cache showpkg <package-name> lists all available versions. (h/t Sparhawk)
  • apt-mark hold <package-name> "holds" the package at the current version, preventing automatic upgrades. (h/t Luís de Sousa )
share|improve this answer
35  
Also, use apt-cache showpkg <package-name> to list available versions. – Sparhawk Apr 2 '13 at 20:42
4  
And afterwards you might also wish to run: apt-mark hold <package-name> in order to avoid automatic upgrades. – Luís de Sousa Apr 17 '15 at 7:42
1  
I found that aptitude downgraded the dependencies better than apt-get. – krispy Mar 1 at 17:25
up vote 52 down vote accepted

USE

apt-get install «pkg»=«version»

OR

sudo aptitude install «pkg»=«version»

Where «pkg» is the name of the package, and «version» is the version number.

share|improve this answer
    
when i type apt-get install pkg=version apt-get offers removing almost half of all installed packages which of course not what i want to do – Dfr Jul 15 '15 at 8:38

If you have upgraded software using ppa you can downgrade it by using ppa-purge. First you have to install ppa-purge using this code:

sudo apt-get install ppa-purge

Then you can remove the ppa using command

sudo ppa-purge ppa:user/ppa-name

this will automatically downgrade the software to its original version which shipped with Ubuntu.

share|improve this answer

In my opinion, you should first uninstall or purge the package, like:

sudo apt-get remove <package>

or

sudo apt-get purge <package>

Then, you may download the version you would like to install and keep it in a folder, say abc.deb in Downloads. Open terminal, move to the folder using cd command and install the previous version using dpkg:

sudo dpkg -i abc.deb

Or else, there is a small utility called ppa-purge if you mean to downgrade packages updated via PPAs.

See this thread: http://www.webupd8.org/2009/12/remove-ppa-repositories-via-command.html

share|improve this answer
3  
removing a package may remove many dependent ones, resulting in an unusable system. ppapurge sounds interesting though. – type May 20 '12 at 19:04
7  
Can you explain why you believe we ought to first uninstall packages (as a separate step) before installing older versions of them? – Eliah Kagan Oct 4 '12 at 20:48
    
    
@temoto that link is for downgrading releases unstable -> testing -> stable not to downgrade individual packages. – Braiam Oct 9 '13 at 17:50

To downgrade you have to do a command like

 sudo apt-get install pkg_name=version

in your terminal.

In the place of version put the previous version you want to downgrade to.

share|improve this answer

protected by RolandiXor Feb 2 '14 at 4:41

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?