SEARCH

How-To Geek

How to Downgrade Packages on Ubuntu

image

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

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.

  • Published 07/2/12

Comments (3)

  1. Kevin James Lausen

    Great post. I Really appreciate the Linux(Ubuntu) articles. I don’t trust Apple, M$, or Adobe. I am really excited about finally starting to get really great, affordable games for Linux. I believe that the Humble Indie bundle proved that Linux users have extra cash we don’t have to pay M$ protection money(anti-virus/backup/…), Apple(BTW…#boycottapple is trending now on G+ for anti-innovation Lawsuits), or adobe(constantly giving the finger to Linux). Once M$ drops silver-light==Netflix 4 Linux Desktop). Ubuntu is partnering w/ Android(I am hoping for googlePlay working on Ubuntu). M$ tablet phones/windows8 preview getting horrible reviews. Did I mention that Nokia is about sick of throwing a hole into the ground w/ windows phone 8. and burring it. I really do believe that GNU/Ubuntu/ is getting setup to be the next gaming platform, video-workstation(novaCut, lightworks), && did I mention that it’s totally Free.

  2. Dude

    I too like Linux. But is it possible that the Linux community hasn’t really learned that much? Are distros like Ubuntu trying to be a lot like the other 2 giants (ASple and M$)?

    Is it just me, or does it seem like there has been an explosion of software problems since the implementation of Unity? If not, then why is there now a need to “downgrade”? Seems like we’ve seen this before. (Hint: look at Windows XP.)

    I say Linux needs better tighter programming and some real leadership that actually has a goal other than to introduce the next cool widget or something. Perhaps implementing a tiered repository system might be something to consider. Something where various PPA’s are categorized according to fewest number of bugs.

    Then again, you just can’t do much when the distro itself is riddled with bad code. That’s just a case of too many cooks in the kitchen (and with no one in charge).

  3. mark

    Great post! Just one minor addition:

    to reverse the changes:

    sudo echo “package_name install”| sudo dpkg –set-selecions
    sudo apt-get update && sudo apt-get upgrade

Enter Your Email Here to Get Access for Free:

Go check your email!