证书机器人要求我激活stretch-backports 来安装它。所以在有了之后
$ cat /etc/apt/sources.list.d/backports.list
deb http://ftp.debian.org/debian stretch-backports main
并做了sudo apt update
我得到的
$ 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]
看起来它确实会继续更新提到的软件包。
然而,从这个答案, 我引用:
来自反向移植的软件包永远不是从主存储库升级的有效安装候选者,仅适用于从反向移植软件包的先前版本升级;因此,虽然
apt list --upgradable
将其列为可升级包,apt upgrade
但不会考虑将其升级。您可以在输出中看到这一点apt-cache policy
所以检查
$ 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
似乎向后移植版本对于升级有效。
如何仅对那些最初从向后移植(即通过apt -t stretch-backports
)安装的软件包启用从向后移植升级?
编辑:我的sources.list
$ 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
答案1
您不需要启用任何功能来强制执行向后移植的记录行为,但您确实需要确保系统知道您安装的软件包来自哪里。在您的情况下,您有一个systemd
from版本stretch/updates
,但您的来源没有引用该版本,因此apt
给已安装版本的systemd
分数为 100,小于或等于向后移植分数(请参阅您的apt policy
输出)。
要解决此问题,请确保您/etc/apt/sources.list
有 的条目stretch-updates
,例如
deb http://ftp.debian.org/debian stretch-updates main
deb-src http://ftp.debian.org/debian stretch-updates main
然后您应该看到apt policy systemd
以下结果:
systemd:
Installed: 232-25+deb9u3
Candidate: 232-25+deb9u3
Version table:
237-3~bpo9+1 100
100 http://ftp.debian.org/debian stretch-backports/main amd64 Packages
*** 232-25+deb9u3 500
500 http://ftp.debian.org/debian stretch-updates/main amd64 Packages
100 /usr/var/lib/dpkg/status
232-25+deb9u2 500
500 http://ftp.debian.org/debian stretch/main amd64 Packages