Downgrading packages: Difference between revisions
m (→Using the pacman cache: remove unnecessary indentation and <small> tags) |
Lahwaacz.bot (talk | contribs) (update interlanguage links) |
||
(23 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Package management]] | [[Category:Package management]] | ||
[[de:Ältere Paketversion installieren (Downgrade)]] | [[de:Ältere Paketversion installieren (Downgrade)]] | ||
[[es:Downgrading packages]] | [[es:Downgrading packages]] | ||
[[fr:Downgrading packages]] | |||
[[fr | |||
[[ja:パッケージのダウングレード]] | [[ja:パッケージのダウングレード]] | ||
[[pt:Downgrading packages]] | [[pt:Downgrading packages]] | ||
[[zh-hans:Downgrading packages]] | [[zh-hans:Downgrading packages]] | ||
{{Related articles start}} | {{Related articles start}} | ||
{{Related|Arch | {{Related|Arch build system}} | ||
{{Related|makepkg}} | {{Related|makepkg}} | ||
{{Related|pacman}} | {{Related|pacman}} | ||
{{Related|Arch Linux Archive}} | {{Related|Arch Linux Archive}} | ||
{{Related articles end}} | {{Related articles end}} | ||
Before downgrading a single or multiple packages, consider why you wish to do so. If it is due to a bug, | Before downgrading a single or multiple packages, consider why you wish to do so. If it is due to a bug, follow the [[bug reporting guidelines]]. I.e. search the Arch Linux Bugtracker for existing tasks and 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 packages to 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 a downgrade involves a soname change, all dependencies may need downgrading or [[ | * If a downgrade involves a soname change, all dependencies 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 applications that depend on it?|rebuilding]] too. | ||
}} | }} | ||
Line 29: | Line 24: | ||
=== Using the pacman cache === | === Using the pacman cache === | ||
If a package was installed at an earlier stage, and the [[Pacman# | If a package was installed at an earlier stage, and the [[Pacman#Cleaning the package cache|pacman cache]] was not cleaned, install an earlier version from {{ic|/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. | 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. | ||
Note that ''{{ic|type}}'' will be {{ic|xz}} for older package builds, and {{ic|zst}} for those following the [https:// | # pacman -U file:///var/cache/pacman/pkg/''package''-''old_version''.pkg.tar.''type'' | ||
Note that ''{{ic|type}}'' will be {{ic|xz}} for older package builds, and {{ic|zst}} for those following the [https://archlinux.org/news/now-using-zstandard-instead-of-xz-for-package-compression/ 2020 change]. | |||
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 43: | Line 38: | ||
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: | 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: | ||
# 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 | # pacman -U file://linux-4.15.8-1-x86_64.pkg.tar.xz file://linux-headers-4.15.8-1-x86_64.pkg.tar.xz file://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 [[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 | {{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}} | ||
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.}} | 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.}} | ||
Line 56: | Line 51: | ||
If the package is unavailable, find the correct [[PKGBUILD]] and rebuild it with [[makepkg]]. | 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 [https:// | For packages from the [[official repositories]], retrieve the PKGBUILD with [[ABS]] and change the software version. Alternatively, find the package on the [https://archlinux.org/packages Packages] website, click "View Changes", and navigate to the desired version. The necessary files can then be downloaded from the directory so that the package can be rebuilt. | ||
See also [[Arch | See also [[Arch build system#Using the pkgctl tool]]. | ||
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]]. | 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]]. | ||
Line 64: | Line 59: | ||
=== Automation === | === Automation === | ||
{{ | * {{App|downgrade|A Bash script to downgrade one (or multiple) packages, by using the pacman cache or the [[Arch Linux Archive]]. See {{man|8|downgrade|url=}} for details.|https://github.com/pbrisbin/downgrade|{{AUR|downgrade}}}} | ||
== Return from [testing] == | == Return from [testing] == | ||
See [[Official repositories#Disabling testing repositories]]. | See [[Official repositories#Disabling testing repositories]]. |
Latest revision as of 18:04, 1 February 2024
Before downgrading a single or multiple packages, consider why you wish to do so. If it is due to a bug, follow the bug reporting guidelines. I.e. search the Arch Linux Bugtracker for existing tasks and if there is none, add a new task. It is better to correct bugs, or at least warn other users of possible issues.
- 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 a downgrade involves a soname change, all dependencies may need downgrading or rebuilding 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 file:///var/cache/pacman/pkg/package-old_version.pkg.tar.type
Note that type
will be xz
for older package builds, and zst
for those following the 2020 change.
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 file://linux-4.15.8-1-x86_64.pkg.tar.xz file://linux-headers-4.15.8-1-x86_64.pkg.tar.xz file://virtualbox-host-modules-arch-5.2.8-4-x86_64.pkg.tar.xz
/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 /mntNow 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 necessary files can then be downloaded from the directory so that the package can be rebuilt.
See also Arch build system#Using the pkgctl tool.
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
- downgrade — A Bash script to downgrade one (or multiple) packages, by using the pacman cache or the Arch Linux Archive. See downgrade(8) for details.