Cherry-picking from testing, or, how to partial upgrade for fun and profit
One of my systems runs on Arch testing, and occasionally I want to pick up a package onto others that are running on stable.
Rather than switching them to testing, or manually downloading packages from the repo or packages page links, I now use something similar to the “Debian way”.
Warning!
This is very unsupported:
This is an “advanced” approach and you shouldn’t do this without a way to chroot in to fix a partial upgrade state. You also need to know which packages do what and be happy to fix your own mess when you make it.
Keep an eye on the to-do list (https://archlinux.org/todo/) and the testing repo state to make sure library versions are compatible. If you see rebuilds happening or core packages like LLVM, GCC, Python, …, in testing then cherry-picking is particularly ill-advised:
https://archlinux.org/packages/?sort=&repo=Community-Testing&repo=Testing&q=&maintainer=&flagged=
Step 1: Enable the testing repos
The testing repos are normally intended to have a higher priority than stable to make sure all related libraries etc. are brought in. That is, normally testing should override stable.
However, to enable easy cherry-picking of certain packages we’re going to enable the testing repos in /etc/pacman.conf
at a lower priority instead:
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[testing]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
[community-testing]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
[multilib]
Include = /etc/pacman.d/mirrorlist
[multilib-testing]
Include = /etc/pacman.d/mirrorlist
Step 2: Notice you can now see the testing repo
After you refresh your package database you’ll see packages from testing available but below the stable packages:
$ pacman -Ss linux-zen
extra/linux-zen 5.10.16.zen1-1 [installed]
The Linux ZEN kernel and modules
extra/linux-zen-docs 5.10.16.zen1-1
Documentation for the Linux ZEN kernel
extra/linux-zen-headers 5.10.16.zen1-1
Headers and scripts for building modules for the Linux ZEN kernel
testing/linux-zen 5.11.zen2-2
The Linux ZEN kernel and modules
testing/linux-zen-docs 5.11.zen2-2
Documentation for the Linux ZEN kernel
testing/linux-zen-headers 5.11.zen2-2
Headers and scripts for building modules for the Linux ZEN kernel
When you perform pacman -Syu
you’ll only get packages from stable.
Step 3: Knowingly partial upgrade your system and draw the ire of #archlinux
Ready?
sudo pacman -S testing/linux-zen
And the result:
$ pacman -Ss linux-zen
extra/linux-zen 5.10.16.zen1-1 [installed: 5.11.zen2-2]
The Linux ZEN kernel and modules
extra/linux-zen-docs 5.10.16.zen1-1
Documentation for the Linux ZEN kernel
extra/linux-zen-headers 5.10.16.zen1-1
Headers and scripts for building modules for the Linux ZEN kernel
testing/linux-zen 5.11.zen2-2 [installed]
The Linux ZEN kernel and modules
testing/linux-zen-docs 5.11.zen2-2
Documentation for the Linux ZEN kernel
testing/linux-zen-headers 5.11.zen2-2
Headers and scripts for building modules for the Linux ZEN kernel
Step 4: Remember what you’ve done and to check for updates in testing
Because the stable repos have priority you won’t automatically get updates from testing - you will have to manually reinstall packages to install updates.
Finally, remember that (yes) partial upgrades are not supported.