Quick Links

Ubuntu’s Update Manager keeps your packages at the latest version, but occasionally a new package version may not work properly. You can downgrade an installed package and lock it at a specific version to prevent it from being updated.

This is particularly useful when you run into an updated package with a regression – a bug that prevents things from working properly.

How It Works

Your system generally has multiple versions of a package available in its repositories – for example, when Ubuntu updates a package, it places the new, updated package in a special updates repository. The old package is still located an Ubuntu’s main repository and can be installed with a few tricks. If you’ve installed a newer version of a package from a personal package archive (PPA), the older packages included with Ubuntu are still located in Ubuntu’s repositories.

As Synaptic warns us, this can cause problems with the package’s dependencies. Ubuntu’s software management system isn’t designed for downgrading packages – considering this an unsupported trick.

Graphically – Synaptic

The Ubuntu Software Center’s simplified interface doesn’t offer the option to downgrade packages. However, 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.

image

After you do, open the Synaptic Package Manager from the Dash.

image

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

image

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

image

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

image

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.

image

Terminal – 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

apt-cache showpkg packagename

image

Next, run the apt-get install command and specify the package version you want to install.

sudo apt-get install packagename=version

image

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 “package hold” | sudo dpkg --set-selections

image