Debian Stretch 希望在啟用向後移植後升級主軟體包

Debian Stretch 希望在啟用向後移植後升級主軟體包

證書機器人要求我啟動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

您不需要啟用任何功能來強制執行向後移植的記錄行為,但您確實需要確保系統知道您安裝的軟體包來自哪裡。在您的情況下,您有一個systemdfrom版本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

相關內容