Debian – Installing Mesa 18 from Stretch-Backports

backportsdebian

I want to install mesa 18 from stretch-backports. Currently all the mesa related packages were marked as automatically installed and I want to keep it that way.

If I simply do

$ sudo apt upgrade -t stretch-backports

It updates mesa but also too many other programs. Is there way to only upgrade packages coming from the mesa source package? Or maybe apt-pin based on source package instead of binary package?

Best Answer

You should always avoid upgrading using -t stretch-backports since backports aren’t a coherent set of packages.

To upgrade all Mesa packages without marking them as manually installed, install them and then unmark them:

sudo apt install -t stretch-backports $(grep-status -S mesa -a -FStatus "install ok installed" -s Package -n | sort -u)
sudo apt-mark auto $(grep-status -S mesa -a -FStatus "install ok installed" -s Package -n | sort -u)

This lists all installed packages which come from the Mesa source package, using grep-status (part of the dctrl-tools package), installs them from backports, and marks them as automatically installed.

Related Question