Debian

為什麼使用“apt upgrade”時沒有安裝 Debian 安全更新?(需要用“-t stable-security”強制)

  • October 14, 2022

apt upgrade使用或之類的命令時,不會安裝 Debian 安全更新apt dist-upgrade。我也試過用apt-get而不是apt.

然而,類似apt upgrade -t stable-securityapt install nodejs -t stable-security將安裝安全更新的命令(例如https://www.debian.org/security/2022/dsa-5170)。

你知道為什麼嗎?這個問題發生在我的 Debian 穩定筆記型電腦上,但我也有一個沒有這個問題的 Debian 穩定伺服器 (VPS)。我檢查了/etc/apt/sources.list兩個安裝中的文件相同,並且沒有/etc/apt/preferences文件。

以下是未註釋的行/etc/apt/sources.list(基於https://wiki.debian.org/SourcesList#Example_sources.list):

deb http://deb.debian.org/debian stable main
deb-src http://deb.debian.org/debian stable main

deb http://deb.debian.org/debian-security/ stable-security main
deb-src http://deb.debian.org/debian-security/ stable-security main

deb http://deb.debian.org/debian stable-updates main
deb-src http://deb.debian.org/debian stable-updates main

deb http://deb.debian.org/debian bullseye-backports main
deb-src http://deb.debian.org/debian bullseye-backports main

為了回答評論中的問題,這裡是輸出apt policy

Package files:
100 /var/lib/dpkg/status
    release a=now
100 http://deb.debian.org/debian bullseye-backports/main i386 Packages
    release o=Debian Backports,a=bullseye-backports,n=bullseye-backports,l=Debian Backports,c=main,b=i386
    origin deb.debian.org
100 http://deb.debian.org/debian bullseye-backports/main amd64 Packages
    release o=Debian Backports,a=bullseye-backports,n=bullseye-backports,l=Debian Backports,c=main,b=amd64
    origin deb.debian.org
500 http://deb.debian.org/debian stable-updates/main i386 Packages
    release v=11-updates,o=Debian,a=stable-updates,n=bullseye-updates,l=Debian,c=main,b=i386
    origin deb.debian.org
500 http://deb.debian.org/debian stable-updates/main amd64 Packages
    release v=11-updates,o=Debian,a=stable-updates,n=bullseye-updates,l=Debian,c=main,b=amd64
    origin deb.debian.org
500 http://deb.debian.org/debian-security stable-security/main i386 Packages
    release v=11,o=Debian,a=stable-security,n=bullseye-security,l=Debian-Security,c=main,b=i386
    origin deb.debian.org
500 http://deb.debian.org/debian-security stable-security/main amd64 Packages
    release v=11,o=Debian,a=stable-security,n=bullseye-security,l=Debian-Security,c=main,b=amd64
    origin deb.debian.org
990 http://deb.debian.org/debian stable/main i386 Packages
    release v=11.5,o=Debian,a=stable,n=bullseye,l=Debian,c=main,b=i386
    origin deb.debian.org
990 http://deb.debian.org/debian stable/main amd64 Packages
    release v=11.5,o=Debian,a=stable,n=bullseye,l=Debian,c=main,b=amd64
    origin deb.debian.org
Pinned packages:

請注意,以前我也有https://download.virtualbox.org/virtualbox/debian顯示在那裡,但我在搜尋問題時評論了它(再次嘗試並/etc/apt/sources.list沒有解決問題)。apt update``apt upgrade

我們可以看到 pinning 的優先級stable高於stable-security,這似乎是問題所在,你知道為什麼嗎?

優先級 990 對應於預設版本;很可能,有一個配置條目說

APT::Default-Release "stable";

或同等學歷。

如果你刪除它,一切都應該自行解決。

引用自:https://unix.stackexchange.com/questions/720984