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?


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.

| improve this answer | |
  • Hi, can you please explain this - "backports aren’t a coherent set of packages" – Bertram Gilfoyle Feb 25 '19 at 6:07
  • 2
    @Anees see the introduction to backports. Full releases of Debian are tested as a whole; backports are tested as small sets of packages (typically the packages from a single source package) on top of the release they target, without consideration for other backported packages. As a result, there’s no guarantee that backported packages will work well with each other. – Stephen Kitt Feb 25 '19 at 8:27
  • Got it. Thanks. Note that I had to install dctrl-tools first in order to get this working. – Bertram Gilfoyle Feb 25 '19 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.