Difference between revisions of "Downgrading packages"

From ArchWiki
Jump to navigation Jump to search
(simplification and beautification of wikilinks, fixing whitespace, capitalization and section fragments (https://github.com/lahwaacz/wiki-scripts/blob/master/link-checker.py (interactive)))
(Undo revision 515664 by Essence-of-foo (talk) - not a reliable tutorial, but a random blog post (using Ubuntu instead of Arch live system etc.))
 
(25 intermediate revisions by 11 users not shown)
Line 7: Line 7:
 
[[it:Downgrading packages]]
 
[[it:Downgrading packages]]
 
[[ja:パッケージのダウングレード]]
 
[[ja:パッケージのダウングレード]]
 +
[[pt:Downgrading packages]]
 
[[ru:Downgrading packages]]
 
[[ru:Downgrading packages]]
 
[[sk:Downgrading packages]]
 
[[sk:Downgrading packages]]
[[tr:Paket sürümünü düşürmek]]
+
[[zh-hans:Downgrading packages]]
[[uk:Downgrading packages]]
 
[[zh-cn:Downgrading packages]]
 
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|Arch Build System}}
 
{{Related|Arch Build System}}
Line 18: Line 17:
 
{{Related|Arch Linux Archive}}
 
{{Related|Arch Linux Archive}}
 
{{Related articles end}}
 
{{Related articles end}}
{{Expansion|soname bumps, cf. [[Frequently_asked_questions#What_if_I_run_a_full_system_upgrade_and_there_will_be_an_update_for_a_shared_library.2C_but_not_for_the_apps_that_depend_on_it.3F]]}}
 
 
 
Before downgrading a single or multiple packages, consider why you wish to do so. If it is due to a bug, search the [https://bugs.archlinux.org/ bug tracker] for existing tasks. If there is none, add a new task; it is better to correct bugs, or at least warn other users of possible issues.
 
Before downgrading a single or multiple packages, consider why you wish to do so. If it is due to a bug, search the [https://bugs.archlinux.org/ bug tracker] for existing tasks. If there is none, add a new task; it is better to correct bugs, or at least warn other users of possible issues.
  
 
{{Warning|
 
{{Warning|
* Downgrading one package may require that its dependencies be downgraded as well. When the number of packages to downgrade is large, consider using a snapshot. See [[Arch Linux Archive#How to restore all my packages at a specific date]].
+
* Downgrading one package may require that its dependencies be downgraded as well. When the number of packages to downgrade is large, consider using a snapshot. See [[Arch Linux Archive#How to restore all packages to a specific date]].
 
* Be careful with changes to configuration files and scripts. For now pacman will handle this for us, as long as we do not bypass its safeguards.
 
* Be careful with changes to configuration files and scripts. For now pacman will handle this for us, as long as we do not bypass its safeguards.
 +
* If the downgrading involve a soname change, all dependency may need downgrading or [[Frequently_asked_questions#What if I run a full system upgrade and there will be an update for a shared library, but not for the apps that depend on it?|rebuild]] too.
 
}}
 
}}
  
Line 35: Line 33:
 
This process will remove the current package and install the older version. Dependency changes will be handled, but [[pacman]] will not handle version conflicts. If a library or other package needs to be downgraded with the packages, please be aware that you will have to downgrade this package yourself as well.
 
This process will remove the current package and install the older version. Dependency changes will be handled, but [[pacman]] will not handle version conflicts. If a library or other package needs to be downgraded with the packages, please be aware that you will have to downgrade this package yourself as well.
 
   
 
   
  # cd /var/cache/pacman/pkg/
+
  # pacman -U /var/cache/pacman/pkg/''package''-''old_version''.pkg.tar.xz
# pacman -U <file_name_of_the_package>
 
  
 
Once the package is reverted, temporarily add it to the [[Pacman#Skip package from being upgraded|IgnorePkg section]] of {{ic|pacman.conf}}, until the difficulty with the updated package is resolved.
 
Once the package is reverted, temporarily add it to the [[Pacman#Skip package from being upgraded|IgnorePkg section]] of {{ic|pacman.conf}}, until the difficulty with the updated package is resolved.
Line 42: Line 39:
 
=== Downgrading the kernel ===
 
=== Downgrading the kernel ===
  
If you are unable to boot after a kernel update, then you can downgrade the kernel via a live CD. Use a fairly recent Arch Linux installation medium. Once it has booted, mount the partition where your system is installed to {{ic|/mnt}}, and if you have {{ic|/boot}} or {{ic|/var}} on separate partitions, mount them there as well (e.g. {{ic|mount /dev/sdc3 /mnt/boot}}). Then [[chroot]] into the system:
+
In case of issue with a new kernel, the Linux packages can be downgraded to the last working ones [[#Using the pacman cache]]. Go into the directory {{ic|/var/cache/pacman/pkg}} and downgrade at least {{Pkg|linux}}, {{Pkg|linux-headers}} and any kernel modules. For example:
 
 
# arch-chroot /mnt /bin/bash
 
 
 
Here you can go to {{ic|/var/cache/pacman/pkg}} and downgrade the packages. At least downgrade {{Pkg|linux}}, {{Pkg|linux-headers}} and any kernel modules. For example:
 
  
  # pacman -U linux-3.5.6-1-x86_64.pkg.tar.xz linux-headers-3.5.6-1-x86_64.pkg.tar.xz virtualbox-host-modules-4.2.0-5-x86_64.pkg.tar.xz
+
  # pacman -U linux-4.15.8-1-x86_64.pkg.tar.xz linux-headers-4.15.8-1-x86_64.pkg.tar.xz virtualbox-host-modules-arch-5.2.8-4-x86_64.pkg.tar.xz
  
Exit the chroot (with {{ic|exit}}), reboot and you should be done.
+
{{Tip|If you are unable to boot after a kernel update, you can downgrade the kernel [[Change root|chrooting]] into the system. Boot using an Arch Linux [[USB flash installation media]] and mount the partition where your system is installed to {{ic|/mnt}}. If you have {{ic|/boot}} or {{ic|/var}} on separate partitions, also mount them to {{ic|/mnt}} (e.g. {{ic|mount /dev/sdc3 /mnt/boot}}). Then ''chroot'' into the system using: {{bc|# arch-chroot /mnt /bin/bash}}
 +
Now you can go into the ''pacman'' cache directory and downgrade the Linux packages using the command indicated above. Once done, exit the chroot (with {{ic|exit}}) and reboot.}}
  
 
=== Arch Linux Archive ===
 
=== Arch Linux Archive ===
  
The [[Arch Linux Archive]] is a daily snapshot of the [[official repositories]].
+
The [[Arch Linux Archive]] is a daily snapshot of the [[official repositories]]. It can be used to [[Arch Linux Archive#How to downgrade one package|install a previous package version]], or [[Arch Linux Archive#How to restore all packages to a specific date|restore the system to an earlier date]].
 
 
The ''ALA'' can be used to install a previous package version, or restore the system to an earlier date.
 
  
 
=== Rebuild the package ===
 
=== Rebuild the package ===
Line 64: Line 56:
 
For packages from the [[official repositories]], retrieve the PKGBUILD with [[ABS]] and change the software version. Alternatively, find the package on the [https://www.archlinux.org/packages Packages] website, click "View Changes", and navigate to the desired version. The files are available through a {{ic|.tar.gz}} snapshot, and via the ''Tree'' view.
 
For packages from the [[official repositories]], retrieve the PKGBUILD with [[ABS]] and change the software version. Alternatively, find the package on the [https://www.archlinux.org/packages Packages] website, click "View Changes", and navigate to the desired version. The files are available through a {{ic|.tar.gz}} snapshot, and via the ''Tree'' view.
  
See also [[Getting PKGBUILDs from SVN#Checkout an older revision of a package]].
+
See also [[Arch Build System#Checkout an older version of a package]].
 
 
Old AUR packages can be obtained from [http://pkgbuild.com/git/aur-mirror.git/ aur-mirror]. See [[Arch User Repository#Git repositories for AUR3 packages]] for details.
 
 
 
==== vABS - Versioned Arch Build System ====
 
  
[https://vabs.archlinux-br.org vABS] is an addition to ABS that has as main goal to keep different versions of the official PKGBUILDs. In ABS you have the latest versions of PKGBUILDs, while in vABS you also have old versions (up to 2 years). Select the desired version and download the build files tgz package or individual files and easily build your package with pkgbuild. More information about the service can be found [https://www.archlinux-br.org/vabs_en here].
+
Old AUR packages can be built by checking out an old commit in the AUR package Git repository. For pre-2015 AUR3 PKGBUILDs, see [[Arch User Repository#Git repositories for AUR3 packages]].
  
 
=== Automation ===
 
=== Automation ===

Latest revision as of 16:13, 3 April 2018

Before downgrading a single or multiple packages, consider why you wish to do so. If it is due to a bug, search the bug tracker for existing tasks. If there is none, add a new task; it is better to correct bugs, or at least warn other users of possible issues.

Warning:
  • Downgrading one package may require that its dependencies be downgraded as well. When the number of packages to downgrade is large, consider using a snapshot. See Arch Linux Archive#How to restore all packages to a specific date.
  • Be careful with changes to configuration files and scripts. For now pacman will handle this for us, as long as we do not bypass its safeguards.
  • If the downgrading involve a soname change, all dependency may need downgrading or rebuild too.

Return to an earlier package version

Using the pacman cache

If a package was installed at an earlier stage, and the pacman cache was not cleaned, install an earlier version from /var/cache/pacman/pkg/.

This process will remove the current package and install the older version. Dependency changes will be handled, but pacman will not handle version conflicts. If a library or other package needs to be downgraded with the packages, please be aware that you will have to downgrade this package yourself as well.

# pacman -U /var/cache/pacman/pkg/package-old_version.pkg.tar.xz

Once the package is reverted, temporarily add it to the IgnorePkg section of pacman.conf, until the difficulty with the updated package is resolved.

Downgrading the kernel

In case of issue with a new kernel, the Linux packages can be downgraded to the last working ones #Using the pacman cache. Go into the directory /var/cache/pacman/pkg and downgrade at least linux, linux-headers and any kernel modules. For example:

# pacman -U linux-4.15.8-1-x86_64.pkg.tar.xz linux-headers-4.15.8-1-x86_64.pkg.tar.xz virtualbox-host-modules-arch-5.2.8-4-x86_64.pkg.tar.xz
Tip: If you are unable to boot after a kernel update, you can downgrade the kernel chrooting into the system. Boot using an Arch Linux USB flash installation media and mount the partition where your system is installed to /mnt. If you have /boot or /var on separate partitions, also mount them to /mnt (e.g. mount /dev/sdc3 /mnt/boot). Then chroot into the system using:
# arch-chroot /mnt /bin/bash
Now you can go into the pacman cache directory and downgrade the Linux packages using the command indicated above. Once done, exit the chroot (with exit) and reboot.

Arch Linux Archive

The Arch Linux Archive is a daily snapshot of the official repositories. It can be used to install a previous package version, or restore the system to an earlier date.

Rebuild the package

If the package is unavailable, find the correct PKGBUILD and rebuild it with makepkg.

For packages from the official repositories, retrieve the PKGBUILD with ABS and change the software version. Alternatively, find the package on the Packages website, click "View Changes", and navigate to the desired version. The files are available through a .tar.gz snapshot, and via the Tree view.

See also Arch Build System#Checkout an older version of a package.

Old AUR packages can be built by checking out an old commit in the AUR package Git repository. For pre-2015 AUR3 PKGBUILDs, see Arch User Repository#Git repositories for AUR3 packages.

Automation

downgraderAUR is a tool which works with libalpm, supports the pacman log and downgrading packages using Arch Linux Archive, local cache and ARM.

The downgradeAUR package is a Bash script to downgrade one (or multiple) packages, by using the pacman cache or the Arch Rollback Machine. See man downgrade for details.

agetpkg-gitAUR quickly lists/gets/installs packages from the Arch Linux Archive.

Return from [testing]

See Official repositories#Disabling testing repositories.