The current nvidia-driver in Bullseye (460) fails to build against the bullseye-backports kernel (5.14). I've experienced this before, and think this is pretty much expected behavior when mixing new/old kernels and nvidia-drivers. Anyway I thought I'd give pinning a go as I haven't dabbled in that before. With a timeshift backup in place, I added bookworm to my sources, and placed the following in /etc/apt/preferences.d/bookworm:
Code: Select all
Package: *
Pin: release n=bookworm
Pin-Priority: 99
I initially had a priority of 400, however this caused an issue with some of my back-ported packages as they have a default priority of 100. I was then able to install the nvidia-driver with dependencies form bookworm using
Code: Select all
sudo apt install -t bookworm nvidia-driver
This appeared to do exactly as I wanted, keeping priority for bullseye, bullseye-updates, and bullseye-backports, unless I explicitly specify -t bookworm during install. Looking at the man page for apt_preferences however, has made me wonder how a priority of 99 will handle any updates.
Code: Select all
100 <= P < 500
causes a version to be installed unless there is a version
available belonging to some other distribution or the installed
version is more recent
0 < P < 100
causes a version to be installed only if there is no installed
version of the package
If I'm reading things right with this setup, apt will still upgrade nvidia-driver if a newer version becomes available in either bullseye-backports or bookworm? Or does the priority of 99 mean once its installed it will not update that version again, even if it's newer, without calling it specifically from apt install? Guides on the web seem to vary from pinning distributions to pinning specific packages (which I would like to avoid.)