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?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0