Vic*_*erc 3 debian apt upgrade unattended-upgrades
在我的 Debian 11 上,一切似乎都已正确设置,但我不知道为什么自从升级到 Debian 11 后,无人值守升级就不再起作用了。
\n当我执行 apt update 时,我发现需要升级的软件包:
\n7 packages can be upgraded. Run 'apt list --upgradable' to see them.\nRun Code Online (Sandbox Code Playgroud)\n这是我的sources.list:
\n# #deb cdrom:[Debian GNU/Linux 10.2.0 _Buster_ - Official amd64 DVD Binary-1 20191116-09:57]/ buster contrib main\n\n#deb cdrom:[Debian GNU/Linux 10.2.0 _Buster_ - Official amd64 DVD Binary-1 20191116-09:57]/ buster contrib main\n\n#deb http://security.debian.org/debian-security buster/updates main contrib\n#deb-src http://security.debian.org/debian-security buster/updates main contrib\n#deb http://ftp.de.debian.org/debian/ stable main\n\ndeb http://ftp.de.debian.org/debian/ stable main\n\ndeb http://deb.debian.org/debian bullseye main\ndeb-src http://deb.debian.org/debian bullseye main\n\ndeb http://deb.debian.org/debian-security/ bullseye-security main contrib\ndeb-src http://deb.debian.org/debian-security/ bullseye-security main contrib\n\ndeb http://deb.debian.org/debian bullseye-updates main\ndeb-src http://deb.debian.org/debian bullseye-updates main\n\ndeb http://deb.debian.org/debian bullseye-backports main\ndeb-src http://deb.debian.org/debian bullseye-backports main\n\n# buster-updates, previously known as 'volatile'\n# A network mirror was not selected during install. The following entries\n# are provided as examples, but you should amend them as appropriate\n# for your mirror of choice.\n#\n# deb http://deb.debian.org/debian/ buster-updates main contrib\n# deb-src http://deb.debian.org/debian/ buster-updates main contrib\nRun Code Online (Sandbox Code Playgroud)\n我在调试模式下的无人值守升级的输出:
\nsudo unattended-upgrades --debug --dry-run\nStarting unattended upgrades script\nAllowed origins are: origin=Debian,codename=bullseye-updates, origin=Debian,codename=bullseye-proposed-updates, origin=Debian,codename=bullseye,label=Debian, origin=Debian,codename=bullseye,label=Debian-Security\nInitial blacklist:\nInitial whitelist (not strict):\nMarking not allowed <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/deb.nodesource.com_node%5f16.x_dists_bullseye_main_binary-amd64_Packages' a=,c=main,v=,o=Node Source,l=Node Source arch='amd64' site='deb.nodesource.com' IndexType='Debian Package Index' Size=1209 ID:14> with -32768 pin\nMarking not allowed <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/deb.debian.org_debian_dists_bullseye-backports_main_i18n_Translation-en' a=bullseye-backports,c=main,v=,o=Debian Backports,l=Debian Backports arch='' site='deb.debian.org' IndexType='Debian Translation Index' Size=377020 ID:13> with -32768 pin\nMarking not allowed <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/deb.debian.org_debian_dists_bullseye-backports_main_binary-amd64_Packages' a=bullseye-backports,c=main,v=,o=Debian Backports,l=Debian Backports arch='amd64' site='deb.debian.org' IndexType='Debian Package Index' Size=656568 ID:12> with -32768 pin\nMarking not allowed <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/deb.debian.org_debian-security_dists_bullseye-security_main_i18n_Translation-en' a=stable-security,c=main,v=11,o=Debian,l=Debian-Security arch='' site='deb.debian.org' IndexType='Debian Translation Index' Size=187892 ID:9> with -32768 pin\nMarking not allowed <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/deb.debian.org_debian-security_dists_bullseye-security_main_binary-amd64_Packages' a=stable-security,c=main,v=11,o=Debian,l=Debian-Security arch='amd64' site='deb.debian.org' IndexType='Debian Package Index' Size=266792 ID:8> with -32768 pin\nApplying pinning: PkgFilePin(id=14, priority=-32768)\nApplying pin -32768 to package_file: <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/deb.nodesource.com_node%5f16.x_dists_bullseye_main_binary-amd64_Packages' a=,c=main,v=,o=Node Source,l=Node Source arch='amd64' site='deb.nodesource.com' IndexType='Debian Package Index' Size=1209 ID:14>\nApplying pinning: PkgFilePin(id=13, priority=-32768)\nApplying pin -32768 to package_file: <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/deb.debian.org_debian_dists_bullseye-backports_main_i18n_Translation-en' a=bullseye-backports,c=main,v=,o=Debian Backports,l=Debian Backports arch='' site='deb.debian.org' IndexType='Debian Translation Index' Size=377020 ID:13>\nApplying pinning: PkgFilePin(id=12, priority=-32768)\nApplying pin -32768 to package_file: <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/deb.debian.org_debian_dists_bullseye-backports_main_binary-amd64_Packages' a=bullseye-backports,c=main,v=,o=Debian Backports,l=Debian Backports arch='amd64' site='deb.debian.org' IndexType='Debian Package Index' Size=656568 ID:12>\nApplying pinning: PkgFilePin(id=9, priority=-32768)\nApplying pin -32768 to package_file: <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/deb.debian.org_debian-security_dists_bullseye-security_main_i18n_Translation-en' a=stable-security,c=main,v=11,o=Debian,l=Debian-Security arch='' site='deb.debian.org' IndexType='Debian Translation Index' Size=187892 ID:9>\nApplying pinning: PkgFilePin(id=8, priority=-32768)\nApplying pin -32768 to package_file: <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/deb.debian.org_debian-security_dists_bullseye-security_main_binary-amd64_Packages' a=stable-security,c=main,v=11,o=Debian,l=Debian-Security arch='amd64' site='deb.debian.org' IndexType='Debian Package Index' Size=266792 ID:8>\nUsing (^linux-.*-[1-9][0-9]*\\.[0-9]+\\.[0-9]+-[0-9]+(-.+)?$|^kfreebsd-.*-[1-9][0-9]*\\.[0-9]+\\.[0-9]+-[0-9]+(-.+)?$|^gnumach-.*-[1-9][0-9]*\\.[0-9]+\\.[0-9]+-[0-9]+(-.+)?$|^.*-modules-[1-9][0-9]*\\.[0-9]+\\.[0-9]+-[0-9]+(-.+)?$|^.*-kernel-[1-9][0-9]*\\.[0-9]+\\.[0-9]+-[0-9]+(-.+)?$|^linux-.*-[1-9][0-9]*\\.[0-9]+\\.[0-9]+-[0-9]+(-.+)?$|^kfreebsd-.*-[1-9][0-9]*\\.[0-9]+\\.[0-9]+-[0-9]+(-.+)?$|^gnumach-.*-[1-9][0-9]*\\.[0-9]+\\.[0-9]+-[0-9]+(-.+)?$|^.*-modules-[1-9][0-9]*\\.[0-9]+\\.[0-9]+-[0-9]+(-.+)?$|^.*-kernel-[1-9][0-9]*\\.[0-9]+\\.[0-9]+-[0-9]+(-.+)?$) regexp to find kernel packages\nUsing (^linux-.*-5\\.10\\.0\\-8\\-amd64$|^linux-.*-5\\.10\\.0\\-8$|^kfreebsd-.*-5\\.10\\.0\\-8\\-amd64$|^kfreebsd-.*-5\\.10\\.0\\-8$|^gnumach-.*-5\\.10\\.0\\-8\\-amd64$|^gnumach-.*-5\\.10\\.0\\-8$|^.*-modules-5\\.10\\.0\\-8\\-amd64$|^.*-modules-5\\.10\\.0\\-8$|^.*-kernel-5\\.10\\.0\\-8\\-amd64$|^.*-kernel-5\\.10\\.0\\-8$|^linux-.*-5\\.10\\.0\\-8\\-amd64$|^linux-.*-5\\.10\\.0\\-8$|^kfreebsd-.*-5\\.10\\.0\\-8\\-amd64$|^kfreebsd-.*-5\\.10\\.0\\-8$|^gnumach-.*-5\\.10\\.0\\-8\\-amd64$|^gnumach-.*-5\\.10\\.0\\-8$|^.*-modules-5\\.10\\.0\\-8\\-amd64$|^.*-modules-5\\.10\\.0\\-8$|^.*-kernel-5\\.10\\.0\\-8\\-amd64$|^.*-kernel-5\\.10\\.0\\-8$) regexp to find running kernel packages\nChecking: gir1.2-javascriptcoregtk-4.0 ([<Origin component:'main' archive:'stable-security' origin:'Debian' label:'Debian-Security' site:'deb.debian.org' isTrusted:True>])\nadjusting candidate version: gir1.2-javascriptcoregtk-4.0=2.32.3-1\nChecking: gir1.2-webkit2-4.0 ([<Origin component:'main' archive:'stable-security' origin:'Debian' label:'Debian-Security' site:'deb.debian.org' isTrusted:True>])\nadjusting candidate version: gir1.2-webkit2-4.0=2.32.3-1\nChecking: libjavascriptcoregtk-4.0-18 ([<Origin component:'main' archive:'stable-security' origin:'Debian' label:'Debian-Security' site:'deb.debian.org' isTrusted:True>])\nadjusting candidate version: libjavascriptcoregtk-4.0-18=2.32.3-1\nChecking: libwebkit2gtk-4.0-37 ([<Origin component:'main' archive:'stable-security' origin:'Debian' label:'Debian-Security' site:'deb.debian.org' isTrusted:True>])\nadjusting candidate version: libwebkit2gtk-4.0-37=2.32.3-1\nChecking: linux-image-5.10.0-8-amd64 ([<Origin component:'main' archive:'stable-security' origin:'Debian' label:'Debian-Security' site:'deb.debian.org' isTrusted:True>])\nadjusting candidate version: linux-image-5.10.0-8-amd64=5.10.46-4\nChecking: linux-image-amd64 ([<Origin component:'main' archive:'stable-security' origin:'Debian' label:'Debian-Security' site:'deb.debian.org' isTrusted:True>])\nadjusting candidate version: linux-image-amd64=5.10.46-4\nChecking: nodejs ([<Origin component:'main' archive:'' origin:'Node Source' label:'Node Source' site:'deb.nodesource.com' isTrusted:True>])\nadjusting candidate version: nodejs=16.9.1-deb-1nodesource1\npkgs that look like they should be upgraded:\nFetched 0 B in 0s (0 B/s)\nfetch.run() result: 0\nPackages blacklist due to conffile prompts: []\nNo packages found that can be upgraded unattended and no pending auto-removals\nThe list of kept packages can't be calculated in dry-run mode.\nRun Code Online (Sandbox Code Playgroud)\n我的无人值守升级配置文件:
\n// Unattended-Upgrade::Origins-Pattern controls which packages are\n// upgraded.\n//\n// Lines below have the format format is "keyword=value,...". A\n// package will be upgraded only if the values in its metadata match\n// all the supplied keywords in a line. (In other words, omitted\n// keywords are wild cards.) The keywords originate from the Release\n// file, but several aliases are accepted. The accepted keywords are:\n// a,archive,suite (eg, "stable")\n// c,component (eg, "main", "contrib", "non-free")\n// l,label (eg, "Debian", "Debian-Security")\n// o,origin (eg, "Debian", "Unofficial Multimedia Packages")\n// n,codename (eg, "jessie", "jessie-updates")\n// site (eg, "http.debian.net")\n// The available values on the system are printed by the command\n// "apt-cache policy", and can be debugged by running\n// "unattended-upgrades -d" and looking at the log file.\n//\n// Within lines unattended-upgrades allows 2 macros whose values are\n// derived from /etc/debian_version:\n// ${distro_id} Installed origin.\n// ${distro_codename} Installed codename (eg, "buster")\nUnattended-Upgrade::Origins-Pattern {\n // Codename based matching:\n // This will follow the migration of a release through different\n // archives (e.g. from testing to stable and later oldstable).\n // Software will be the latest available for the named release,\n // but the Debian release itself will not be automatically upgraded.\n "origin=Debian,codename=${distro_codename}-updates";\n "origin=Debian,codename=${distro_codename}-proposed-updates";\n "origin=Debian,codename=${distro_codename},label=Debian";\n "origin=Debian,codename=${distro_codename},label=Debian-Security";\n\n // Archive or Suite based matching:\n // Note that this will silently match a different release after\n // migration to the specified archive (e.g. testing becomes the\n // new stable).\n// "o=Debian,a=stable";\n// "o=Debian,a=stable-updates";\n// "o=Debian,a=proposed-updates";\n// "o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports";\n};\n\n// Python regular expressions, matching packages to exclude from upgrading\nUnattended-Upgrade::Package-Blacklist {\n // The following matches all packages starting with linux-\n// "linux-";\n\n // Use $ to explicitely define the end of a package name. Without\n // the $, "libc6" would match all of them.\n// "libc6$";\n// "libc6-dev$";\n// "libc6-i686$";\n\n // Special characters need escaping\n// "libstdc\\+\\+6$";\n\n // The following matches packages like xen-system-amd64, xen-utils-4.1,\n // xenstore-utils and libxenstore3.0\n// "(lib)?xen(store)?";\n\n // For more information about Python regular expressions, see\n // https://docs.python.org/3/howto/regex.html\n};\n\n// This option allows you to control if on a unclean dpkg exit\n// unattended-upgrades will automatically run \n// dpkg --force-confold --configure -a\n// The default is true, to ensure updates keep getting installed\n//Unattended-Upgrade::AutoFixInterruptedDpkg "true";\n\n// Split the upgrade into the smallest possible chunks so that\n// they can be interrupted with SIGTERM. This makes the upgrade\n// a bit slower but it has the benefit that shutdown while a upgrade\n// is running is possible (with a small delay)\n//Unattended-Upgrade::MinimalSteps "true";\n\n// Install all updates when the machine is shutting down\n// instead of doing it in the background while the machine is running.\n// This will (obviously) make shutdown slower.\n// Unattended-upgrades increases logind's InhibitDelayMaxSec to 30s.\n// This allows more time for unattended-upgrades to shut down gracefully\n// or even install a few packages in InstallOnShutdown mode, but is still a\n// big step back from the 30 minutes allowed for InstallOnShutdown previously.\n// Users enabling InstallOnShutdown mode are advised to increase\n// InhibitDelayMaxSec even further, possibly to 30 minutes.\n//Unattended-Upgrade::InstallOnShutdown "false";\n\n// Send email to this address for problems or packages upgrades\n// If empty or unset then no email is sent, make sure that you\n// have a working mail setup on your system. A package that provides\n// 'mailx' must be installed. E.g. "user@example.com"\nUnattended-Upgrade::Mail "myemail@myemail.com";\n\n// Set this value to "true" to get emails only on errors. Default\n// is to always send a mail if Unattended-Upgrade::Mail is set\nUnattended-Upgrade::MailOnlyOnError "false";\n\n// Remove unused automatically installed kernel-related packages\n// (kernel images, kernel headers and kernel version locked tools).\nUnattended-Upgrade::Remove-Unused-Kernel-Packages "true";\n\n// Do automatic removal of newly unused dependencies after the upgrade\nUnattended-Upgrade::Remove-New-Unused-Dependencies "true";\n\n// Do automatic removal of unused packages after the upgrade\n// (equivalent to apt-get autoremove)\nUnattended-Upgrade::Remove-Unused-Dependencies "true";\n\n// Automatically reboot *WITHOUT CONFIRMATION* if\n// the file /var/run/reboot-required is found after the upgrade\nUnattended-Upgrade::Automatic-Reboot "true";\n\n// Automatically reboot even if there are users currently logged in\n// when Unattended-Upgrade::Automatic-Reboot is set to true\nUnattended-Upgrade::Automatic-Reboot-WithUsers "false";\n\n// If automatic reboot is enabled and needed, reboot at the specific\n// time instead of immediately\n// Default: "now"\nUnattended-Upgrade::Automatic-Reboot-Time "02:00";\n\n// Use apt bandwidth limit feature, this example limits the download\n// speed to 70kb/sec\n//Acquire::http::Dl-Limit "70";\n\n// Enable logging to syslog. Default is False\n// Unattended-Upgrade::SyslogEnable "false";\n\n// Specify syslog facility. Default is daemon\n// Unattended-Upgrade::SyslogFacility "daemon";\n\n// Download and install upgrades only on AC power\n// (i.e. skip or gracefully stop updates on battery)\n// Unattended-Upgrade::OnlyOnACPower "true";\n\n// Download and install upgrades only on non-metered connection\n// (i.e. skip or gracefully stop updates on a metered connection)\n// Unattended-Upgrade::Skip-Updates-On-Metered-Connections "true";\n\n// Verbose logging\nUnattended-Upgrade::Verbose "true";\n\n// Print debugging information both in unattended-upgrades and\n// in unattended-upgrade-shutdown\nUnattended-Upgrade::Debug "true";\nRun Code Online (Sandbox Code Playgroud)\n20 个自动升级也已正确定制:
\nAPT::Periodic::Update-Package-Lists "1";\nAPT::Periodic::Unattended-Upgrade "1";\nRun Code Online (Sandbox Code Playgroud)\n据我所见,该服务工作正常:
\n sudo systemctl status unattended-upgrades.service\n \xe2\x97\x8f unattended-upgrades.service - Unattended Upgrades Shutdown\n Loaded: loaded (/lib/systemd/system/unattended-upgrades.service; enabled; vendor preset: enabled)\n Active: active (running) since Mon 2021-10-04 13:12:12 CEST; 27s ago\n Docs: man:unattended-upgrade(8)\n Main PID: 561 (unattended-upgr)\n Tasks: 2 (limit: 19156)\n Memory: 20.8M\n CPU: 213ms\n CGroup: /system.slice/unattended-upgrades.service\n \xe2\x94\x94\xe2\x94\x80561 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal\n\nOct 04 13:12:12 WIPMagentoLocal systemd[1]: Started Unattended Upgrades Shutdown.\nRun Code Online (Sandbox Code Playgroud)\n你能帮我让它再次工作吗?谢谢!
\n对于 Debian 11 中的安全更新,您需要将\xe2\x80\x9cDebian-Security\xe2\x80\x9d 行更改/etc/apt/apt.conf.d/50unattended-upgrades为
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";\nRun Code Online (Sandbox Code Playgroud)\n(注意添加-security)。
| 归档时间: |
|
| 查看次数: |
3044 次 |
| 最近记录: |