Categories
Self-organization

How to downgrade packages on ubuntu

A friend of mine asked me how to downgrade a package to its lower versions. I already know how to downgrade a package in Arch Linux, but I haven’t downgraded packages in Ubuntu. After a bit of search in Ubuntu forums, I found that there is an easy way to do this. Read on further to know how can we downgrade package in Ubuntu and its derivatives.

Downgrade A Package In Ubuntu

For the purpose of this tutorial, I am going to downgrade Firefox package.

Let us see the currently installed Firefox version.

How to downgrade packages on ubuntu

As you see in the above screenshot, my Firefox version is 50.

Say for example, I want to downgrade this Firefox version to its lower version i.e 45. How can I do that? That’s what you’re going to learn today.

But wait, I don’t know the available older versions in the repositories, how can I find it out?

Run the command from your Terminal to list the available versions in the repositories.

How to downgrade packages on ubuntu

The above command will display the available Firefox version.

Let us downgrade Firefox version to 45. To do so, run:

Type “y” and hit ENTER key.

Sample output:

How to downgrade packages on ubuntu

Note: You should mention the version exactly as shown in the above command. If there is any spelling mistakes, this command will not downgrade the package and will display there is no such package in the repositories.

Restart all running Firefox instances. Now, you will see the Firefox has been downgraded to the older version.

How to downgrade packages on ubuntu

Alternatively, you can check the Firefox version from Terminal using command:

I want to keep Firefox version 48 forever. I don’t want to upgrade it automatically. How can I do that? It’s easy too. Read the following guide to know how to prevent a package from being automatically upgraded to next available version.

How to downgrade packages on ubuntu

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.

How to downgrade packages on ubuntu

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

How to downgrade packages on ubuntu

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

How to downgrade packages on ubuntu

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

How to downgrade packages on ubuntu

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

How to downgrade packages on ubuntu

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.

How to downgrade packages on ubuntu

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

How to downgrade packages on ubuntu

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

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

This article explains how to downgrade a package to a specific version using apt, in Debian, Ubuntu or Linux Mint (from the command line).

Sometimes you may encounter issues with a recently upgraded package, and you want to downgrade it. To be able to downgrade a package in Debian, Ubuntu or Linux Mint (and other Debian/Ubuntu-based Linux distributions), the package version to which you want to downgrade must be available in a repository.

From the same series:

Let’s look at a simple example. I currently have Firefox 65 installed in Ubuntu 18.10, and I want to downgrade it using apt. The first thing to do is to look at the available versions, by running apt policy firefox ( apt-cache policy works as well):

This apt command shows that the Firefox version installed on my system is 65.0+build2-0ubuntu0.18.10.1, and it’s available in the cosmic-security and cosmic-updates repositories. There is an older version, 63.0+build1-0ubuntu1, available in the main repository, so Firefox can be downgraded to this version.

To downgrade Firefox from the installed 65.0+build2-0ubuntu0.18.10.1 version, to the 63.0+build1-0ubuntu1 version from the main repository, the command would be:

This command downgrades Firefox without having to downgrade any other packages, because Firefox doesn’t depend on any strict package versions:

There are cases in which you must resolve some dependencies to be able to downgrade the package though, and we’ll look at an example like that below.

Let’s look at a more complicated example – a package that can’t be directly downgraded using apt without also downgrading some of its dependencies.

The apt policy command above shows that I currently have Chromium browser beta (version 72) installed from the Saiarcot Chromium Beta PPA, with two older versions being available in the Ubuntu security/updates and main repositories.

Let’s try to downgrade chromium browser from version 72.0.3626.81-0ubuntu1

18.10.1 to version 71.0.3578.98-0ubuntu0.18.10.1 (from the security/updates repositories) using apt and see what happens:

Downgrading Chromium browser doesn’t work because it depends on chromium-codecs-ffmpeg-extra or chromium-codecs-ffmpeg , with the exact same version as the chromium-browser package itself. In this case, let’s also downgrade the chromium-codecs-ffmpeg-extra package to the same version:

The apt downgrade command output shows that chromium-browser can now be downgraded, but the command wants to remove 2 packages. Those are recommended packages that were automatically installed when chromium-browser was installed (and they too need to be the exact same version as the chromium-browser package), and while they are not required by chromium-browser, you may still need them. So it’s a good idea to downgrade those as well, so they are not removed.

In this case, the apt downgrade command becomes:

Let’s look at what happens when we use it:

As you can see, the downgrade can be performed, and no packages are about to be removed. Since it all looks good now, we can proceed with the downgrade.

Sometimes when using Ubuntu, programs don’t work correctly. If this happens, it may be because a recent upgrade is less stable than the previous version. To fix this problem, you can downgrade software on Ubuntu to an earlier version.

There are a few ways to downgrade software on Ubuntu. Specifically, the Linux terminal (via the apt-cache system) and the Synaptic package manager. In this post, we will demonstrate how to use both of these tools to downgrade software on Ubuntu.

Downgrade software via apt-cache

Ubuntu uses the Apt/Apt-get program management tools. One of the features of these tools is that each time a package is set up on the system, it is archived in something known as the “Apt-cache.” In this cache, you’ll find several different versions of programs you previously installed. So, for example, say six months ago you installed Wine version 3.6. Then, the other day it was upgraded to version 4.0. The 3.6 release is still in the cache and can be used if you need it.

The apt-cache system is a great way to downgrade programs on Ubuntu that give you issues. Though, keep in mind that it’s not 100% reliable. Why? Well, many users run the apt clean command to clean up their Ubuntu systems from excess junk, and one of the results of running this command is that it clears the apt-cache.

Users don’t need to install any software to interact with the apt-cache, as the Ubuntu package manager comes with lots of useful commands built-in. Here’s how it works.

Step 1: Open up a terminal window on your Ubuntu PC by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard.

Step 2: Use the apt-cache show command in the Linux terminal to search Ubuntu’s package cache for the program you want to downgrade.

Step 3: Look through the on-screen printout of search results that the apt-cache search command returns, and keep an eye out for the version of the program you want. For example, if you have issues with Firefox version 65, you should look for a version below that in the search results, etc.

How to downgrade packages on ubuntu

Step 4: Once you’ve found the version of the app you want to force Ubuntu to use, it’s time to install it using the Apt package management tool. Be sure to specify the exact version number you found in the search results of the apt-cache search command in the “version” area of the command below.

How to downgrade packages on ubuntu

Other ways to find versions of packages on Ubuntu

The apt-cache search method of detecting different versions of packages in the Ubuntu apt-cache is pretty reliable. However, it’s not the only way users can find different versions of programs on Ubuntu if they’d like to downgrade a problematic application. Here’s an alternative way to do it, without the “search” command.

Step 1: Open up a terminal on your Ubuntu PC by pressing Ctrl + Alt + T or Ctrl + Shift + T.

Step 2: Run the apt-cache policy command. Using “policy” will show you all available versions of a particular package, as well as where they can be installed.

Step 3: Install the program on your Linux system with apt. Like before, you must specify the exact version number.

Downgrade via Synaptic Package Manager

If you’re not a fan of the apt-cache way of doing things, it’s possible to use the Synaptic package manager to force your system to use a specific version of a program — effectively downgrading software. Sadly, the Synaptic package manager was taken out of Ubuntu as a default piece of software some time ago, so before we continue, you must install it. To get it working, launch a terminal window and enter the command below.

After installing Synaptic, start it up by searching for it in your application menu. When the program opens up, you’ll be asked to enter your password. Do so.

Once Synaptic is open, look for the search button and click on it. Then, write in the name of the package (aka program) you’d like to downgrade and search for it on the system.

Look through the search results and click on the program you want to downgrade. After that, click on the menu that says “Package,” and choose the “Force version” option.

How to downgrade packages on ubuntu

Clicking “Force version” in Synaptic will bring up a menu for your selected package and allow you to choose alternative versions of the program. Using the menu, select an older version then click the “Force” version button to downgrade.

How to downgrade packages on ubuntu

Finish up the package downgrade process by clicking the “Apply” button at the top.

Undo the downgrade

If it turns out you want to undo your program downgrade on Ubuntu, here’s what to do.

Step 1: Open up a terminal window and run the update command to check for software updates.

Step 2: Run the upgrade command. Ubuntu will notice that the previously downgraded software is out of date, and will install the latest version automatically.

After doing an update on a bunch of pulseaudio packages my microphone stopped working. It’s fine, after all Karmic is still in Alpha. I have reported the bug to launchpad.

In the meanwhile I would like to revert the update of the pulseaudio packages. Unfortunately, none of the packages let me select the “Force Version” option on Synaptic. I thought of removing them and then install the old packages, however removing pulse means removing the package called ubuntu-desktop which I am afraid might mess up things even more. I had a hard time finding the older versions of the packages but I finally downloaded each one of the *.deb’s onto my machine.

These are the updates according to the history in Synaptic.

4 Answers 4

If you are not afraid do get your hands dirty, the best way to do this is :

It will show you all the different version of the package that you can install, according to your sources.list definition. You will get something like that ( this is how it looks for me ):

Just check on the different version available to you, and then do :

Again as example to the output above :

As you can see my pulseaudio is from a ppa on launchpad so if i wanted to downgrade/revert back to the original one supplied by jaunty, i’d do the mentioned above with all the pulseaudio packages that i installed.

, which will show you only the available versions and their sources, so you get exactly the information you need instead of all the extra stuff that apt-cache show provides. – jk. Oct 18 ’09 at 14:44

Then aptitude install pulseaudio (and any other packages that won’t get automatically downgraded as a dependency).

This may well cause problems down the line (downgrades aren’t officially supported or well-tested) but this will at least get the versions down to jaunty ones.

womble is right

You also have to make sure that you have the lines in /etc/apt/sources.list for jaunty. If you have the correct sources.list lines then you can select the right one from multiple versions.

With pinning you can set the preference what version you prefer.

You can try using “aptitude”, it has a console based user interface. Go to the relevant packages, at the bottom, you’ll see available versions. Select the versions you want and press “+” on your keyboard.

There will probably be “broken” packages, you can cycle them with “b” and fix them as you go.

Not the answer you’re looking for? Browse other questions tagged ubuntu apt packages or ask your own question.

Related

Hot Network Questions

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

  • Blog
  • Facebook
  • Twitter
  • LinkedIn
  • Instagram

site design / logo © 2020 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2020.12.10.38158

If you’ve added a PPA and run into a nasty bug in your updated software, you should revert back to the Ubuntu repositories. Doing it safely can be tricky – fortunately Ubuntu Tweak can do this for us.

How to downgrade packages on ubuntu

Remove Unwanted Packages

There are a few issues involved in removing a PPA. The simplest is to remove any packages that were provided solely by that PPA.

For example, if we tried out the beta version of Firefox 4.0, we should remove all of the firefox-4.0 packages before removing the Firefox nightly builds PPA. To do this, we’ll open up a terminal (Applications > Accessories > Terminal or Ctrl+Alt+T) and type in the following command.

The exact command will depend on the packages you need to remove. If you don’t remember all of the packages provided by a certain PPA, the best thing to do is to visit the PPA’s Launchpad page and look at the packages it provides.

Downgrade Updated Packages

Ubuntu Tweak offers an easy way to downgrade any packages that the PPA upgraded – and even if you don’t need to downgrade, we recommend following the steps in this section because it will also disable the PPA.

The first step is to install Ubuntu Tweak if you don’t already have it installed. Ubuntu Tweak isn’t in the Ubuntu repositories, but fortunately it has its own PPA: ppa:tualatrix/ppa. You call follow our more detailed guide to adding new PPAs, or simply open a terminal and type in the following commands.

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

Once installed, you can find Ubuntu Tweak in the Applications > System Tools menu.

How to downgrade packages on ubuntu

Open Ubuntu Tweak, and select Package Cleaner in the list on the left.

Click on the Purge PPAs button near the right. If the list of PPAs is greyed out, click on the Unlock button and enter your administrator password.

How to downgrade packages on ubuntu

Select the PPAs you want to remove by clicking on the checkbox next to them. Click the Cleanup button when you’re done.

You’ll be prompted to downgrade packages that have earlier versions in the Ubuntu repositories. In our case, we are removing the PPA that contains nightly builds of Mozilla Firefox.

How to downgrade packages on ubuntu

Click Yes and Ubuntu Tweak will do the downgrade for you.

How to downgrade packages on ubuntu

If you want to return your system to the same state that it was before installing the PPA, you can use Ubuntu Tweak to remove its own PPA, and then apt-get remove ubuntu-tweak . However, we recommend keeping Ubuntu Tweak around for all the other neat things it does!

Posted Aug 31, 2019

How to downgrade packages on ubuntu

Sometimes you might install an application on your Ubuntu, and after trying it, you decide this app is not for you. In this case, you’ll probably want to uninstall the package.

In this article, we will show you how to uninstall software packages using the graphical “Ubuntu Software Center” and through the command-line, using the apt or apt-get commands.

Only root or user with sudo privileges can uninstall packages from Ubuntu.

Uninstalling Packages using the Ubuntu Software Center #

If the command-line is not your thing, you can uninstall applications through the Ubuntu Software Center (USC). This utility provides a graphical interface to find, install, and uninstall apps.

In the Activities screen, search for “Ubuntu Software” and click on the orange USC icon. This will open the USC tool.

To get a list of all installed applications, click on the “Installed” tab at the top navigation bar.

Scroll down until you find the application you want to uninstall and click on the “Remove” button next to it.

How to downgrade packages on ubuntu

The Ubuntu Software tool shows only installed applications that have a graphical user interface (GUI). If you cannot find the package that you want to uninstall, then you should remove the package from the command line.

Uninstalling Packages using the Command Line #

Everything you can do using the GUI tools, you can do from the command line. In fact, the command line gives you more options and control for uninstalling the software packages.

You can open your terminal either by using the Ctrl+Alt+T keyboard shortcut or by clicking on the terminal icon.

Before uninstalling the software package, you must first find the exact package name. To get a list of all installed packages on your system type:

The command will print a long list of the installed packages. It might be a good idea to pipe the output to less to make it easier to read. Or you can use grep to filter the results.

On Ubuntu, Debian, and related Linux distributions you can install, update, uninstall and otherwise managing software packages using the apt and apt-get command-line utilities. The syntax of both commands is identical.

To remove an installed package, run the following command:

Replace package_name the name of the package you want to remove.

You can also uninstall multiple packages. The packages names should b separated by space:

The remove command uninstalls the given packages, but it may leave some package files behind. If you want to remove the package including all its files, use purge instead of remove :

Uninstall Snap Packages #

If the application you want to uninstall is not listed when running sudo apt list –installed then probably it was installed as a snap package.

To list all installed snap package run the following command:

Once you know the exact package name you can uninstall it by typing:

Uninstall Unused Packages #

Whenever you install a new package that depends on other packages, the package dependencies will be installed too. When the package is uninstalled, the dependency packages will stay on the system. This leftover packages are no longer used by anything else and can be removed.

You can remove the unneeded packages with:

Conclusion #

We have shown you how to remove applications from your Ubuntu through the command line and using the Ubuntu Software Center. Knowing how to remove packages is an essential part of Linux system administration.

There are a number of reasons why you will want to remove a previously installed package from your Ubuntu. For example, you might need to uninstall an application that you no longer need or to free up your disk space.

Feel free to leave a comment if you have any questions.

How to downgrade packages on ubuntu

Sometimes Linux packages break. A new update goes through, yet it wasn’t tested well. Maybe you’re running a bleeding edge distribution or a strange custom configuration. You could even just want to keep an older version of a package around for testing or to hold back a change.

There are plenty of reasons that you’d want to roll your Linux install back to an earlier version of a package. The process is dependent on your distribution’s package manager, but it should be possible in most cases.

Ubuntu/Debian

How to downgrade packages on ubuntu

Apt is one of the most beloved package managers in the Linux world, but in this case it’s easily one of the most awkward and cumbersome options to work with. Apt doesn’t have any set mechanisms to roll back packages, and it doesn’t have a caching system that you can really count on in these situations. That said, you can usually find a way to install an older version of a package.

That will spit out a whole lot of info that you probably don’t need, but it will also show you previously installed versions of the package or additional versions.

How to downgrade packages on ubuntu

Once you have a package selected, install it by specifying the version.

There’s another option here. If you can find an older version of a package that you want, you can download it separately and install it with dpkg (more on dpkg here). You can even find them from an older release of your distribution. For example, if you’re running Ubuntu Bionic, you can install a package from Xenial. In that case you can do something like the following:

Fedora

Fedora’s DNF package manager has a couple of very useful mechanisms built in that allow you to install a previous version of a package or roll back past any change or upgrade.

How to downgrade packages on ubuntu

First, and probably most simply, you can install a previous version of a package from DNF’s repositories. Begin by listing all available options.

DNF will present you with all versions of the package in your enabled repositories. Pick the one you want, and install it by specifying the version number to DNF.

DNF will install the version of the package that you specified over the existing version.

How to downgrade packages on ubuntu

As mentioned earlier, DNF keeps a complete history with snapshots. You can use that history to revert your system to an earlier state. Begin by listing DNF’s history.

It should be easy to find the point you want to return to, but you can easily get information on a DNF transaction with its ID number.

When you’re sure you have the right one, undo the transaction.

DNF will reverse that transaction, returning your system to the prior state.

OpenSUSE

On OpenSUSE you can manage this either graphically with YaST or via the command line with Zypper. This guide will cover Zypper, since it’s both the most direct and the most universal.

To start, search through your Zypper history with grep .

Once you’ve found the version that you want to revert to, install it.

Arch Linux

Rolling back packages to an earlier version on Arch Linux is very simple, providing you don’t clear Pacman’s cache too frequently. Pacman, Arch’s package manager, stores every package that you install in a designated cache folder.

As with most things in Arch, this is designed for simplicity. The Arch developers understand that bugs are bound to slip through occasionally in a distribution as fast-paced as Arch, so they’ve made the rollback process as uncomplicated as possible.

Check which versions are available by listing the contents of “/var/cache/pacman/pkg/.” You’ll have an easier time if you search with grep .

Once you’ve located it, install it with Pacman.

Pacman will automatically install the older version over the current package.

That’s all you need to do. Follow the process that fits your distribution, and you’ll be able to return your system to a previous, and hopefully less problematic, version of a package. You should also keep in mind that these methods all go against the regular flow of your distribution, so they may not always work. They’re a great first step, and something you should always try, tough.

Nick is a freelance tech. journalist, Linux enthusiast, and a long time PC gamer.

In this tutorial, you will be shown advanced package management for Ubuntu Server, including how to downgrade packages and holding a package at a specific version.

While most day-to-day operations of an Ubuntu server usually include full system updates or installing the latest packages, there are times where we may need a specific version of package . You may also find yourself in a scenario where a package must be downgraded to address a bug introduced in an upgrade.

Installing a Specific Package Version

While most package installations target the most recently released updates, there are times where we need to install specific version for satisfying other requirements. It could that third-party vendor solution requires has only been qualified for a version two releases below the most recent one.

There are two methods for installing a specific package version. One is to provide the entire package name, including version number, with the apt-get install command.

The second method is to use the -t flag with apt install to target a specific release version.

Downgrading an Installed Package

To downgrade an installed package we simply install a previous version available from the package’s source repo. We use the same commands used above to install a specific version.

Apt will remove the currently installed version and replace it with the version we specify.

Listing All Available Package Version

While it is useful to understand how to install a specific package version, you will be limited to the version available from the source package repo. The apt-cache command can be used to list all available version of a package.

Prevent a Package from Updating

On occasion, you could be required to always run a specific version of a package. In order to prevent a package from being upgraded a hold can be placed on the currently installed version. The hold will prevent a package from being updated whenever the entire system is updated using apt upgrade.

To place a hold on a package version, the apt-mark command is used.