Linux

無人值守升級報告是什麼意思packageonholdp一個Cķ一個G和○nH○ldpackage on hold?

  • May 15, 2021

我正在執行安裝和配置無人值守升級的樹莓派(Raspbian 10 – buster)。今天收到一封郵件報告,內容如下:

Unattended upgrade result: All upgrades installed

Packages with upgradable origin but kept back:
linux-libc-dev

**目標:**進行配置unattended-upgrades,使其不會因為包裹滯留而不會(每天)向我發送通知。它可以自行安裝它們,也可以不發送郵件報告。設置Unattended-Upgrade::MailOnlyOnErrortrue對我來說不是一個選項,因為我希望收到有關成功升級的通知。

我的配置如下:

/etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Origins-Pattern {
       "origin=Debian,codename=${distro_codename},label=Debian";
       "origin=Debian,codename=${distro_codename},label=Debian-Security";
};

Unattended-Upgrade::Package-Blacklist {

};


Unattended-Upgrade::Mail "MYMAILADDRESS";
Unattended-Upgrade::Sender "SENDERADDRESS";

Unattended-Upgrade::Remove-Unused-Dependencies "true";

Unattended-Upgrade::Automatic-Reboot "true";

編輯: 輸出apt-cache policy linux-libc-dev

linux-libc-dev:
 Installed: 4.18.20-2+rpi1
 Candidate: 1:1.20210430-2
 Version table:
    1:1.20210430-2 500
       500 http://archive.raspberrypi.org/debian buster/main armhf Packages
    5.10.28-1+rpi1 -1
        -1 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages
*** 4.18.20-2+rpi1 500
       500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
       100 /var/lib/dpkg/status

的輸出apt-get -d install linux-libc-dev

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
 linux-libc-dev
1 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.
Need to get 1.011 kB of archives.
After this operation, 54,3 kB disk space will be freed.
Get:1 http://archive.raspberrypi.org/debian buster/main armhf linux-libc-dev armhf 1:1.20210430-2 [1.011 kB]
Fetched 1.011 kB in 0s (3.006 kB/s)      
Download complete and in download only mode

到目前為止,我只找到了一些文章,解釋瞭如何通過將包放入包黑名單欄位來防止包被更新。但是,這在我的配置中是空的。那麼為什麼軟體包linux-libc-dev被阻止升級呢?是否有另一種我不知道的配置可能導致這種情況?它與我配置的 Origins-Pattern 有關嗎?

感謝您提前提供任何建議!

我猜自動升級不能正常工作,因為 Release 文件http://archive.raspberrypi.org/debian/dists/buster/InRelease並且http://raspbian.raspberrypi.org/raspbian/dists/buster/InRelease沒有 Origin 等於Debianor Debian-security。因此,這些儲存庫與中的設置不匹配,Unattended-Upgrade::Origins-Pattern並且未選擇自動升級源候選者。它們的相關資訊塊分別是:

Origin: Raspberry Pi Foundation
Label: Raspberry Pi Foundation
Suite: testing
Codename: buster
Date: Fri, 14 May 2021 23:17:18 UTC
Architectures: armhf arm64 i386 amd64
Components: main ui untested

這真的很奇怪:testing而不是stable,同樣,stretch被標記為stable而不是oldstable。我想這是一個技巧,因為(根據這個論壇archive.raspberrypi.org旨在添加比 Debian穩定版中提供的更新的軟體raspbian.rasberrypi.org,因此buster的狀態是“升級”到那裡的測試。這只是一個假設,不影響答案。

和:

Origin: Raspbian
Label: Raspbian
Suite: stable
Codename: buster
Date: Sat, 15 May 2021 04:52:10 UTC
Architectures: armhf
Components: main contrib non-free rpi firmware

您應該編輯您/etc/apt/apt.conf.d/50unattended-upgrades的條目以匹配特定於 Raspberry 儲存庫的值。這應該有效:

Unattended-Upgrade::Origins-Pattern {
       "origin=Raspbian,codename=${distro_codename},label=Raspbian";
       "origin=Raspberry Pi Foundation,codename=${distro_codename},label=Raspberry Pi Foundation";
};

檢查周圍沒有任何其他隱藏的東西也應該改變。

我刪除了 Debian 儲存庫,因為確實不建議配置 Debian 儲存庫,尤其是不用於自動升級。

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