Downgrading packages

From ArchWiki
Revision as of 10:00, 9 June 2009 by Iphitus (talk | contribs)
Jump to: navigation, search

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end

Note: Before downgrading, consider why you're downgrading. If it's because of a bug please report the bug. Please help both Arch and upstream developers by spending a mere 5 minutes of your time reporting the bug. After all, Arch is on the cutting edge and bugs are inevitable.

Both us and the upstream developers appreciate the effort. That extra bit of information could save us hours of testing and debugging and also helps us release more stable software.

Iphitus 05:58, 9 June 2009 (EDT)

How to downgrade a package

  • Q: I just ran pacman -Syu and package XYZ was upgraded to version N from version M. This package is causing problems on my computer, how can I downgrade from version N to the older version M?
  • A: You may be able to downgrade the package trivially by visiting /var/cache/pacman/pkg on your system and seeing if the older version of the package is stored there. (If you haven't run pacman -Scc recently, it should be there). If the package is there, you can install that version using pacman -U pkgname-olderpkgver.pkg.tar.gz. If pacman complains about file conflicts, you could force it to do the installation anyway with pacman -Uf pkgname-olderpkgver.pkg.tar.gz.

If you can't find older versions on your system, check if one of the mirrors is out of sync, and get it from there. Click here to see the status of mirrors.

You can also check one of these mirrors:

If the package is not located there, you will need to compile the older version yourself. To do this you will need a PKGBUILD for the file; you could edit the existing PKGBUILD provided by ABS to use older sources, or you can visit and search for the package you wish to downgrade. Once you find it, click "View SVN entries" and select a diff with a previous revision (ie: for the revision you are interested in). If you use a "side by side" diff, you can copy and paste the entire PKGBUILD into a file and build it with makepkg.

The Arch Rollback Machine contains archived snapshots of all the repos going back to 1 October 2008. I've been using this site to manually locate and download older versions of packages. The urls are constructed in such a way to facility easy wget+pacman scripting to "roll back" your system to a particular date. The introductory forum thread is here.

What about dependencies?

  • Q: I can't downgrade a package, because of dependencies.
  • A: You can ignore dependencies when upgrading or removing with 'd'. e.g. pacman -Ud pkgpkgname-olderpkgver.pkg.tar.gz.

Stopping Pacman from updating certain packages

  • Q: How do I stop Pacman from upgrading downgraded packages?
  • A: With the 'IgnorePkg' variable in your pacman.conf.

'IgnorePkg = package1 package2 ...' in your pacman.conf instructs Pacman to ignore any upgrades for selected packages when performing a --sysupgrade.

Reverting to a Savepoint

  • Q: I want to go back to how my system was yesterday.
  • A: It's easy provided you enabled periodic snapshots.

You can rely on a logical volume manager (LVM) for creating and maintaining snapshots. These snapshots should not be confused with CVS snapshots. LVM snapshots are kernel-level filesystem snapshots that, unlike a full backup, use a COW (copy-on-write) scheme which means that it occupies very little disk space so long as no files were modified, and if files were modified, the snapshot occupies only a little more than the disk space needed to store the pre-modified files. This usually means that you can snapshot a 35GB system with only 2GB free space, considering that pacman -Sy will likely modify far less than 2GB of data. If the state of your system after the upgrade is undesirable, you can quickly rollback to previous snapshot images of your system.

See Also