Selectively install Debian experimental packages

2 minute read Published: 2023-05-20

I'm using Debian testing with the Sway window manager without the Xwayland translation layer: this means that I am forcing myself to use only pure Wayland application (it's a way to test how the ecosystem is evolving).

Gimp 2.10.x does not support this configuration so I need to install the unstable version Gimp 2.99.

Since the Debian experimental release channel has Gimp 2.99, I've learned a nice trick to selectively install packages from another release channel. Worth noting that mixing packages from different release channels can lead to an unstable system but in this case it works just fine. As usual nothing earth-shattering but this article will help me remember the procedure.

Instructions at the Debian wiki.

Step 1: Add the experimental repository to the /etc/sources.list

$ sudo echo "deb experimental main" >> /etc/sources.list 

Step 2: Pin the specific package to that release channel by creating the file /etc/apt/preferences.d/gimp:

Package: gimp
Pin: release a=experimental
Pin-Priority: 800

Step 3: Update the package cache

$ sudo apt update
$ apt list --upgradable
Listing... Done
gimp/experimental 2.99.14-2+b1 amd64 [upgradable from: 2.10.34-1]
less/testing,testing 590-2 amd64 [upgradable from: 590-1.2]

Notice that while all the packages are still from the usual testing channel, Gimp is now pulled from the the experimental repository.

Step 4: Off you go, install the package from the experimental channel:

$ sudo apt -t experimental install gimp