我正在运行一个树莓派(Raspbian 10——buster),安装并配置了无人值守升级。今天我收到一封邮件报告,内容如下:
Unattended upgrade result: All upgrades installed
Packages with upgradable origin but kept back:
linux-libc-dev
目标:配置unattended-upgrades
以便它不会因包裹被扣留而向我发送通知(每天)。它可以自行安装它们,也可以不发送邮件报告。设置Unattended-Upgrade::MailOnlyOnError
为对我来说true
不是一个选项,因为我希望收到升级成功的通知。
我的配置如下:
/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 有关吗?
感谢您提前提供任何建议!
答案1
我猜自动升级不能正常工作,因为Release文件http://archive.raspberrypi.org/debian/dists/buster/InRelease
和http://raspbian.raspberrypi.org/raspbian/dists/buster/InRelease
没有等于Debian
或 的原点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
这真的很奇怪:测试代替稳定的, 同样地拉紧被标记为稳定的代替旧稳定。我猜这是一个与以下事实有关的技巧(根据这个论坛)archive.raspberrypi.org
旨在添加比 Debian 提供的更新的软件稳定的等价于 中提供的raspbian.rasberrypi.org
,所以巴斯特的状态“升级”为测试那里。这只是一个假设,不影响答案。
和:
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 存储库配置,特别是不用于自动升级。