How to install a previous version of a package

Sometimes, one bug fixed may introduce new ones, or what's known as a regression. This trick will allow you to roll back to the previous package version, providing you know which one.

:warning: Warning

This is an advanced approach, please take care and do this at your own risk.


The Commands

This assumes you already know which update caused the problem.

List the versions

apt-cache show [package name] | fgrep Version:

For example, compiz may output something like this:

Version: 1:0.9.12.2+15.10.20151202-0ubuntu1
Version: 1:0.9.12.2+15.10.20151015-0ubuntu1

We can see the bottom one is an earlier build.

Install a specific version

sudo apt-get install [package name]=[version]

For example:

sudo apt-get install compiz=1:0.9.12.2+15.10.20151015-0ubuntu1

Be warned, any related packages will not be automatically downgraded, so you will need to also specify additional packages to be downgraded.

The command could look something like this:

sudo apt-get install compiz=1:0.9.12.2+15.10.20151015-0ubuntu1 \
compiz-core=1:0.9.12.2+15.10.20151015-0ubuntu1 \
compiz-gnome=1:0.9.12.2+15.10.20151015-0ubuntu1 \
compiz-plugins-default=1:0.9.12.2+15.10.20151015-0ubuntu1 \
libcompizconfig0=1:0.9.12.2+15.10.20151015-0ubuntu1 \
libdecoration0=1:0.9.12.2+15.10.20151015-0ubuntu1

Lock the package

To avoid it ever being updated again, lock the package using Synaptic.


In most cases, downgrading a package should just be a short-term thing.

Hope this helps. :slightly_smiling:


Be part of the solution, not the problem.

Filing a bug on Launchpad or even confirming another users' report matching your problem greatly helps increase awareness and allows developers to discuss and correct the problem. :thumbsup:

2 Likes