我试图阻止 Debian 12 中的一些软件包通过无人值守升级自动更新:
/etc/apt/apt.conf.d/50unattended-upgrades
默认黑名单的部分是这样的:
// Python regular expressions, matching packages to exclude from upgrading
Unattended-Upgrade::Package-Blacklist {
// The following matches all packages starting with linux-
// "linux-";
// Use $ to explicitely define the end of a package name. Without
// the $, "libc6" would match all of them.
// "libc6$";
// "libc6-dev$";
// "libc6-i686$";
// Special characters need escaping
// "libstdc\+\+6$";
// The following matches packages like xen-system-amd64, xen-utils-4.1,
// xenstore-utils and libxenstore3.0
// "(lib)?xen(store)?";
// For more information about Python regular expressions, see
// https://docs.python.org/3/howto/regex.html
};
如果我想将特定软件包版本的升级列入黑名单``
- openvpn=2.6.3-1+deb12u1
- docker-ce=5:24.0.0-1~debian.12~bookworm
- docker-ce-cli=5:24.0.0-1~debian.12~bookworm
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
// "linux-";
这可以通过取消注释并替换为来完成吗
"openvpn-";
"docker-";
"containerd.io$";
此外,我对配置文件中这一行的含义感到困惑:它是更新所有包还是仅更新与安全相关的包?我只想自动更新安全包。
"origin=Debian,codename=${distro_codename},label=Debian";
上面的完整片段:
Unattended-Upgrade::Origins-Pattern {
// Codename based matching:
// This will follow the migration of a release through different
// archives (e.g. from testing to stable and later oldstable).
// Software will be the latest available for the named release,
// but the Debian release itself will not be automatically upgraded.
// "origin=Debian,codename=${distro_codename}-updates";
// "origin=Debian,codename=${distro_codename}-proposed-updates";
"origin=Debian,codename=${distro_codename},label=Debian";
"origin=Debian,codename=${distro_codename},label=Debian-Security";
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
// Archive or Suite based matching:
// Note that this will silently match a different release after
// migration to the specified archive (e.g. testing becomes the
// new stable).
// "o=Debian,a=stable";
// "o=Debian,a=stable-updates";
// "o=Debian,a=proposed-updates";
// "o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports";
};