Certbot requires me to activate stretch-backports for its installation. So after having
$ cat /etc/apt/sources.list.d/backports.list deb http://ftp.debian.org/debian stretch-backports main
and doing a
sudo apt update I get
$ apt list --upgradable Listing... Done libpam-systemd/stretch-backports 237-3~bpo9+1 amd64 [upgradable from: 232-25+deb9u3] libsystemd0/stretch-backports 237-3~bpo9+1 amd64 [upgradable from: 232-25+deb9u3] libudev1/stretch-backports 237-3~bpo9+1 amd64 [upgradable from: 232-25+deb9u3] systemd/stretch-backports 237-3~bpo9+1 amd64 [upgradable from: 232-25+deb9u3] systemd-sysv/stretch-backports 237-3~bpo9+1 amd64 [upgradable from: 232-25+deb9u3] udev/stretch-backports 237-3~bpo9+1 amd64 [upgradable from: 232-25+deb9u3] $ sudo apt upgrade [...] The following packages have been kept back: systemd-sysv The following packages will be upgraded: libpam-systemd libsystemd0 libudev1 systemd udev 5 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. Need to get 4,795 kB of archives. After this operation, 2,540 kB of additional disk space will be used. Do you want to continue? [Y/n]
It really looks like it would continue updating the packages mentioned.
However, from this answer, I quote:
Packages from backports are never valid installation candidates for an upgrade from the main repositories, only for upgrade from a previous version of a backported package; so while
apt list --upgradablelists it as an upgradable package,
apt upgradewon’t consider it for upgrade. You can see this in the output of
$ apt policy systemd systemd: Installed: 232-25+deb9u3 Candidate: 237-3~bpo9+1 Version table: 237-3~bpo9+1 100 100 http://ftp.debian.org/debian stretch-backports/main amd64 Packages *** 232-25+deb9u3 100 100 /var/lib/dpkg/status 232-25+deb9u2 500 500 http://ftp.debian.org/debian stretch/main amd64 Packages
it seems like the backports version is valid for upgrade.
How can I enable upgrading from backports only for those packages which were originally installed from backports (i.e. via
apt -t stretch-backports)?
$ cat /etc/apt/sources.list deb http://ftp.debian.org/debian stretch main deb-src http://ftp.debian.org/debian stretch main deb http://security.debian.org/debian-security stretch/updates main contrib deb-src http://security.debian.org/debian-security stretch/updates main contrib