无人值守升级在关机时不开始更新

无人值守升级在关机时不开始更新

我在这里用 Ubuntu Server 20.04 构建了一个新版本,主要用作 NAS,但也用作 Jellyfin 媒体服务器。

我希望它能够通过无人值守升级自行执行更新,因为最终用户不知道如何自行执行更新。

由于该服务器不会全天候运行,我希望它能够在计算机关闭时启动更新过程,这要归功于无人值守升级的相关选项。

这是我目前所做的:

$ sudo nano /etc/apt/apt.conf.d/21auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::RandomSleep "1";
APT::Periodic::Verbose "2";

$ sudo nano /etc/apt/apt.conf.d/51unattended-upgrades
Unattended-Upgrade::Allowed-Origins {
    "${distro_id}:${distro_codename}";
    "${distro_id}:${distro_codename}-security";
    "${distro_id}ESMApps:${distro_codename}-apps-security";
    "${distro_id}ESM:${distro_codename}-infra-security";
    "${distro_id}:${distro_codename}-updates";
};

Unattended-Upgrade::Package-Blacklist {
    "grub*";
    "jellyfin*";
};

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

Unattended-Upgrade::Verbose "true";
Unattended-Upgrade::Debug "true";

Unattended-Upgrade::InstallOnShutdown "true";

(由于 Grub 需要人工输入并且 Jellyfin 尚未“稳定”,因此我选择不更新它们)

我读到,最好将 InhibitDelayMaxSec 的默认时间增加到 30 秒,以防更新过程需要更多时间。因此,为了安全起见,我在以下两个配置文件中设置了 30 分钟:

$ sudo nano /usr/lib/systemd/logind.conf.d/unattended-upgrades-logind-maxdelay.conf
-> InhibitDelayMaxSec=1800

$ sudo nano /etc/systemd/logind.conf
-> InhibitDelayMaxSec=1800

以下是无人值守升级的日志(/var/log/unattended-upgrades/unattended-upgrades.log):

2020-08-31 10:08:54,859 DEBUG Running on the development release
2020-08-31 10:08:54,860 INFO Starting unattended upgrades script
2020-08-31 10:08:54,862 INFO Allowed origins are: o=Ubuntu,a=focal, o=Ubuntu,a=focal-security, o=UbuntuESMApps,a=focal-apps-security, o=UbuntuESM,a=focal-infra-security, o=Ubuntu,a=focal, o=Ubuntu,a=focal-security, o=UbuntuESMApps,a=focal-apps-security, o=UbuntuESM,a=focal-infra-security, o=Ubuntu,a=focal-updates
2020-08-31 10:08:54,863 INFO Initial blacklist: grub* jellyfin*
2020-08-31 10:08:54,863 INFO Initial whitelist (not strict):
2020-08-31 10:08:55,351 DEBUG Marking not allowed <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/repo.jellyfin.org_ubuntu_dists_focal_main_binary-amd64_Packages'  a=,c=main,v=,o=Jellyfin,l=Jellyfin arch='amd64' site='repo.jellyfin.org' IndexType='Debian Package Index' Size=3920 ID:26> with -32768 pin
2020-08-31 10:08:55,351 DEBUG Marking not allowed <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/ch.archive.ubuntu.com_ubuntu_dists_focal-backports_universe_i18n_Translation-en'  a=focal-backports,c=universe,v=20.04,o=Ubuntu,l=Ubuntu arch='' site='ch.archive.ubuntu.com' IndexType='Debian Translation Index' Size=3232 ID:17> with -32768 pin
2020-08-31 10:08:55,352 DEBUG Marking not allowed <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/ch.archive.ubuntu.com_ubuntu_dists_focal-backports_universe_binary-amd64_Packages'  a=focal-backports,c=universe,v=20.04,o=Ubuntu,l=Ubuntu arch='amd64' site='ch.archive.ubuntu.com' IndexType='Debian Package Index' Size=12498 ID:16> with -32768 pin
2020-08-31 10:08:55,700 DEBUG Applying pinning: PkgFilePin(id=26, priority=-32768)
2020-08-31 10:08:55,701 DEBUG Applying pin -32768 to package_file: <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/repo.jellyfin.org_ubuntu_dists_focal_main_binary-amd64_Packages'  a=,c=main,v=,o=Jellyfin,l=Jellyfin arch='amd64' site='repo.jellyfin.org' IndexType='Debian Package Index' Size=3920 ID:26>
2020-08-31 10:08:55,701 DEBUG Applying pinning: PkgFilePin(id=17, priority=-32768)
2020-08-31 10:08:55,701 DEBUG Applying pin -32768 to package_file: <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/ch.archive.ubuntu.com_ubuntu_dists_focal-backports_universe_i18n_Translation-en'  a=focal-backports,c=universe,v=20.04,o=Ubuntu,l=Ubuntu arch='' site='ch.archive.ubuntu.com' IndexType='Debian Translation Index' Size=3232 ID:17>
2020-08-31 10:08:55,701 DEBUG Applying pinning: PkgFilePin(id=16, priority=-32768)
2020-08-31 10:08:55,701 DEBUG Applying pin -32768 to package_file: <apt_pkg.PackageFile object: filename:'/var/lib/apt/lists/ch.archive.ubuntu.com_ubuntu_dists_focal-backports_universe_binary-amd64_Packages'  a=focal-backports,c=universe,v=20.04,o=Ubuntu,l=Ubuntu arch='amd64' site='ch.archive.ubuntu.com' IndexType='Debian Package Index' Size=12498 ID:16>
2020-08-31 10:08:55,701 DEBUG Applying pinning: PkgPin(pkg='grub-uboot', priority=-32768)
2020-08-31 10:08:55,701 DEBUG Applying pinning: PkgPin(pkg='grub-legacy', priority=-32768)
2020-08-31 10:08:55,701 DEBUG Applying pinning: PkgPin(pkg='grub-doc', priority=-32768)
2020-08-31 10:08:55,701 DEBUG Applying pinning: PkgPin(pkg='grub-ipxe', priority=-32768)
2020-08-31 10:08:55,702 DEBUG Applying pinning: PkgPin(pkg='grub-efi', priority=-32768)
2020-08-31 10:08:55,702 DEBUG Applying pinning: PkgPin(pkg='grub-emu', priority=-32768)
2020-08-31 10:08:55,702 DEBUG Applying pinning: PkgPin(pkg='grub-coreboot', priority=-32768)
2020-08-31 10:08:55,702 DEBUG Applying pinning: PkgPin(pkg='grub-efi-arm64-signed', priority=-32768)
2020-08-31 10:08:55,702 DEBUG Applying pinning: PkgPin(pkg='grub-linuxbios', priority=-32768)
2020-08-31 10:08:55,702 DEBUG Applying pinning: PkgPin(pkg='grub-common', priority=-32768)
2020-08-31 10:08:55,702 DEBUG Applying pinning: PkgPin(pkg='grub-customizer', priority=-32768)
2020-08-31 10:08:55,702 DEBUG Applying pinning: PkgPin(pkg='grub-efi-amd64-signed-template', priority=-32768)
2020-08-31 10:08:55,702 DEBUG Applying pinning: PkgPin(pkg='grub-invaders', priority=-32768)
2020-08-31 10:08:55,702 DEBUG Applying pinning: PkgPin(pkg='grub-coreboot-bin', priority=-32768)
2020-08-31 10:08:55,703 DEBUG Applying pinning: PkgPin(pkg='grub-ieee1275-bin', priority=-32768)
2020-08-31 10:08:55,703 DEBUG Applying pinning: PkgPin(pkg='grub-coreboot-dbg', priority=-32768)
2020-08-31 10:08:55,703 DEBUG Applying pinning: PkgPin(pkg='grub-xen-bin', priority=-32768)
2020-08-31 10:08:55,703 DEBUG Applying pinning: PkgPin(pkg='grub-ieee1275-dbg', priority=-32768)
2020-08-31 10:08:55,703 DEBUG Applying pinning: PkgPin(pkg='grub-xen-dbg', priority=-32768)
2020-08-31 10:08:55,703 DEBUG Applying pinning: PkgPin(pkg='grub2-common', priority=-32768)
2020-08-31 10:08:55,703 DEBUG Applying pinning: PkgPin(pkg='grub-legacy-doc', priority=-32768)
2020-08-31 10:08:55,703 DEBUG Applying pinning: PkgPin(pkg='grub-legacy-ec2', priority=-32768)
2020-08-31 10:08:55,703 DEBUG Applying pinning: PkgPin(pkg='grub-splashimages', priority=-32768)
2020-08-31 10:08:55,704 DEBUG Applying pinning: PkgPin(pkg='grub-yeeloong', priority=-32768)
2020-08-31 10:08:55,704 DEBUG Applying pinning: PkgPin(pkg='grub-pc', priority=-32768)
2020-08-31 10:08:55,704 DEBUG Applying pinning: PkgPin(pkg='grub-cloud-amd64', priority=-32768)
2020-08-31 10:08:55,704 DEBUG Applying pinning: PkgPin(pkg='grub-theme-breeze', priority=-32768)
2020-08-31 10:08:55,704 DEBUG Applying pinning: PkgPin(pkg='grub-imageboot', priority=-32768)
2020-08-31 10:08:55,704 DEBUG Applying pinning: PkgPin(pkg='grub-efi-arm64', priority=-32768)
2020-08-31 10:08:55,704 DEBUG Applying pinning: PkgPin(pkg='grub-xen', priority=-32768)
2020-08-31 10:08:55,704 DEBUG Applying pinning: PkgPin(pkg='grub-pc-bin', priority=-32768)
2020-08-31 10:08:55,704 DEBUG Applying pinning: PkgPin(pkg='grub-efi-ia32-signed', priority=-32768)
2020-08-31 10:08:55,704 DEBUG Applying pinning: PkgPin(pkg='grub-pc-dbg', priority=-32768)
2020-08-31 10:08:55,705 DEBUG Applying pinning: PkgPin(pkg='grub-efi-amd64-bin', priority=-32768)
2020-08-31 10:08:55,705 DEBUG Applying pinning: PkgPin(pkg='grub-gfxpayload-lists', priority=-32768)
2020-08-31 10:08:55,705 DEBUG Applying pinning: PkgPin(pkg='grub-efi-amd64-dbg', priority=-32768)
2020-08-31 10:08:55,705 DEBUG Applying pinning: PkgPin(pkg='grubzfs-testsuite', priority=-32768)
2020-08-31 10:08:55,705 DEBUG Applying pinning: PkgPin(pkg='grub2-themes-ubuntu-mate', priority=-32768)
2020-08-31 10:08:55,705 DEBUG Applying pinning: PkgPin(pkg='grub-efi-arm', priority=-32768)
2020-08-31 10:08:55,705 DEBUG Applying pinning: PkgPin(pkg='grub-rescue-pc', priority=-32768)
2020-08-31 10:08:55,705 DEBUG Applying pinning: PkgPin(pkg='grub2-themes-ubuntustudio', priority=-32768)
2020-08-31 10:08:55,705 DEBUG Applying pinning: PkgPin(pkg='grub-ieee1275', priority=-32768)
2020-08-31 10:08:55,705 DEBUG Applying pinning: PkgPin(pkg='grub', priority=-32768)
2020-08-31 10:08:55,706 DEBUG Applying pinning: PkgPin(pkg='grun', priority=-32768)
2020-08-31 10:08:55,706 DEBUG Applying pinning: PkgPin(pkg='grub2', priority=-32768)
2020-08-31 10:08:55,706 DEBUG Applying pinning: PkgPin(pkg='grunt', priority=-32768)
2020-08-31 10:08:55,706 DEBUG Applying pinning: PkgPin(pkg='grub-efi-amd64', priority=-32768)
2020-08-31 10:08:55,706 DEBUG Applying pinning: PkgPin(pkg='grub-efi-ia32', priority=-32768)
2020-08-31 10:08:55,706 DEBUG Applying pinning: PkgPin(pkg='grub-efi-ia64', priority=-32768)
2020-08-31 10:08:55,706 DEBUG Applying pinning: PkgPin(pkg='grub-efi-amd64-signed', priority=-32768)
2020-08-31 10:08:55,706 DEBUG Applying pinning: PkgPin(pkg='grub-efi-ia32-bin', priority=-32768)
2020-08-31 10:08:55,706 DEBUG Applying pinning: PkgPin(pkg='grub2-splashimages', priority=-32768)
2020-08-31 10:08:55,706 DEBUG Applying pinning: PkgPin(pkg='grub-efi-ia32-dbg', priority=-32768)
2020-08-31 10:08:55,707 DEBUG Applying pinning: PkgPin(pkg='grub-emu-dbg', priority=-32768)
2020-08-31 10:08:55,707 DEBUG Applying pinning: PkgPin(pkg='grub-firmware-qemu', priority=-32768)
2020-08-31 10:08:55,707 DEBUG Applying pinning: PkgPin(pkg='jellyfish', priority=-32768)
2020-08-31 10:08:55,707 DEBUG Applying pinning: PkgPin(pkg='jellyfin-web', priority=-32768)
2020-08-31 10:08:55,707 DEBUG Applying pinning: PkgPin(pkg='jellyfin-ffmpeg', priority=-32768)
2020-08-31 10:08:55,707 DEBUG Applying pinning: PkgPin(pkg='jellyfish1', priority=-32768)
2020-08-31 10:08:55,708 DEBUG Applying pinning: PkgPin(pkg='jellyfin-server', priority=-32768)
2020-08-31 10:08:55,708 DEBUG Applying pinning: PkgPin(pkg='jellyfin', priority=-32768)
2020-08-31 10:08:55,719 DEBUG Using (^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
2020-08-31 10:08:55,720 DEBUG Using (^linux-.*-5\.4\.0\-42\-generic$|^linux-.*-5\.4\.0\-42$|^kfreebsd-.*-5\.4\.0\-42\-generic$|^kfreebsd-.*-5\.4\.0\-42$|^gnumach-.*-5\.4\.0\-42\-generic$|^gnumach-.*-5\.4\.0\-42$|^.*-modules-5\.4\.0\-42\-generic$|^.*-modules-5\.4\.0\-42$|^.*-kernel-5\.4\.0\-42\-generic$|^.*-kernel-5\.4\.0\-42$|^linux-.*-5\.4\.0\-42\-generic$|^linux-.*-5\.4\.0\-42$|^kfreebsd-.*-5\.4\.0\-42\-generic$|^kfreebsd-.*-5\.4\.0\-42$|^gnumach-.*-5\.4\.0\-42\-generic$|^gnumach-.*-5\.4\.0\-42$|^.*-modules-5\.4\.0\-42\-generic$|^.*-modules-5\.4\.0\-42$|^.*-kernel-5\.4\.0\-42\-generic$|^.*-kernel-5\.4\.0\-42$) regexp to find running kernel packages
2020-08-31 10:08:56,261 DEBUG Checking: apport ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:56,472 DEBUG Checking: bind9-dnsutils ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'focal-security' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:56,691 DEBUG Checking: bind9-host ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'focal-security' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:56,918 DEBUG Checking: bind9-libs ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'focal-security' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:57,119 DEBUG Checking: curl ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'focal-security' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:57,425 DEBUG Checking: jellyfin ([<Origin component:'main' archive:'' origin:'Jellyfin' label:'Jellyfin' site:'repo.jellyfin.org' isTrusted:True>])
2020-08-31 10:08:57,432 DEBUG adjusting candidate version: jellyfin=10.6.2-1
2020-08-31 10:08:57,471 DEBUG Checking: jellyfin-server ([<Origin component:'main' archive:'' origin:'Jellyfin' label:'Jellyfin' site:'repo.jellyfin.org' isTrusted:True>])
2020-08-31 10:08:57,478 DEBUG adjusting candidate version: jellyfin-server=10.6.2-1
2020-08-31 10:08:57,517 DEBUG Checking: jellyfin-web ([<Origin component:'main' archive:'' origin:'Jellyfin' label:'Jellyfin' site:'repo.jellyfin.org' isTrusted:True>])
2020-08-31 10:08:57,524 DEBUG adjusting candidate version: jellyfin-web=10.6.2-1
2020-08-31 10:08:57,598 DEBUG Checking: libcurl3-gnutls ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'focal-security' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:57,844 DEBUG Checking: libcurl4 ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'focal-security' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:58,056 DEBUG Checking: libdns-export1109 ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:58,346 DEBUG Checking: libisc-export1105 ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:58,605 DEBUG Checking: liblzma5 ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:58,992 DEBUG Checking: python3-apport ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:59,215 DEBUG Checking: python3-problem-report ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:59,483 DEBUG Checking: rsyslog ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:08:59,758 DEBUG Checking: tmux ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:09:00,027 DEBUG Checking: xz-utils ([<Origin component:'main' archive:'focal-updates' origin:'Ubuntu' label:'Ubuntu' site:'ch.archive.ubuntu.com' isTrusted:True>])
2020-08-31 10:09:00,643 DEBUG pkgs that look like they should be upgraded: apport
bind9-dnsutils
bind9-host
bind9-libs
curl
libcurl3-gnutls
libcurl4
libdns-export1109
libisc-export1105
liblzma5
python3-apport
python3-problem-report
rsyslog
tmux
xz-utils
2020-08-31 10:09:03,246 DEBUG fetch.run() result: 0
2020-08-31 10:09:03,611 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 427240 DestFile:'/var/cache/apt/archives/rsyslog_8.2001.0-1ubuntu1.1_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/r/rsyslog/rsyslog_8.2001.0-1ubuntu1.1_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,612 DEBUG check_conffile_prompt(/var/cache/apt/archives/rsyslog_8.2001.0-1ubuntu1.1_amd64.deb)
2020-08-31 10:09:03,615 DEBUG found pkg: rsyslog
2020-08-31 10:09:03,616 DEBUG conffile line: /etc/apparmor.d/usr.sbin.rsyslogd 88fe4a6a37a5cbb88fcadf1e564874c2
2020-08-31 10:09:03,617 DEBUG current md5: 88fe4a6a37a5cbb88fcadf1e564874c2
2020-08-31 10:09:03,617 DEBUG conffile line: /etc/init.d/rsyslog bd41a0654a192d74dfb9c551b06fa855
2020-08-31 10:09:03,617 DEBUG current md5: bd41a0654a192d74dfb9c551b06fa855
2020-08-31 10:09:03,617 DEBUG conffile line: /etc/logcheck/ignore.d.server/rsyslog 80e9fc074b97751dd4de99855bb8d0e0
2020-08-31 10:09:03,618 DEBUG current md5: 80e9fc074b97751dd4de99855bb8d0e0
2020-08-31 10:09:03,618 DEBUG conffile line: /etc/logrotate.d/rsyslog 8159203bf98416c898849057f585e31f
2020-08-31 10:09:03,618 DEBUG current md5: 8159203bf98416c898849057f585e31f
2020-08-31 10:09:03,618 DEBUG conffile line: /etc/rsyslog.conf 8f03326e3d7284ef50ac6777ef8a4fb8
2020-08-31 10:09:03,619 DEBUG current md5: 8f03326e3d7284ef50ac6777ef8a4fb8
2020-08-31 10:09:03,619 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 91724 DestFile:'/var/cache/apt/archives/liblzma5_5.2.4-1ubuntu1_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/x/xz-utils/liblzma5_5.2.4-1ubuntu1_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,619 DEBUG check_conffile_prompt(/var/cache/apt/archives/liblzma5_5.2.4-1ubuntu1_amd64.deb)
2020-08-31 10:09:03,620 DEBUG found pkg: liblzma5
2020-08-31 10:09:03,622 DEBUG No conffiles in deb /var/cache/apt/archives/liblzma5_5.2.4-1ubuntu1_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,623 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 174936 DestFile:'/var/cache/apt/archives/libisc-export1105_1%3a9.11.16+dfsg-3~ubuntu1_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/b/bind9-libs/libisc-export1105_9.11.16+dfsg-3~ubuntu1_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,623 DEBUG check_conffile_prompt(/var/cache/apt/archives/libisc-export1105_1%3a9.11.16+dfsg-3~ubuntu1_amd64.deb)
2020-08-31 10:09:03,624 DEBUG found pkg: libisc-export1105
2020-08-31 10:09:03,626 DEBUG No conffiles in deb /var/cache/apt/archives/libisc-export1105_1%3a9.11.16+dfsg-3~ubuntu1_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,626 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 765124 DestFile:'/var/cache/apt/archives/libdns-export1109_1%3a9.11.16+dfsg-3~ubuntu1_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/b/bind9-libs/libdns-export1109_9.11.16+dfsg-3~ubuntu1_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,626 DEBUG check_conffile_prompt(/var/cache/apt/archives/libdns-export1109_1%3a9.11.16+dfsg-3~ubuntu1_amd64.deb)
2020-08-31 10:09:03,628 DEBUG found pkg: libdns-export1109
2020-08-31 10:09:03,630 DEBUG No conffiles in deb /var/cache/apt/archives/libdns-export1109_1%3a9.11.16+dfsg-3~ubuntu1_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,630 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 82508 DestFile:'/var/cache/apt/archives/xz-utils_5.2.4-1ubuntu1_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/x/xz-utils/xz-utils_5.2.4-1ubuntu1_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,630 DEBUG check_conffile_prompt(/var/cache/apt/archives/xz-utils_5.2.4-1ubuntu1_amd64.deb)
2020-08-31 10:09:03,633 DEBUG found pkg: xz-utils
2020-08-31 10:09:03,633 DEBUG No conffiles in deb /var/cache/apt/archives/xz-utils_5.2.4-1ubuntu1_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,633 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 134108 DestFile:'/var/cache/apt/archives/bind9-dnsutils_1%3a9.16.1-0ubuntu2.3_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/b/bind9/bind9-dnsutils_9.16.1-0ubuntu2.3_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,634 DEBUG check_conffile_prompt(/var/cache/apt/archives/bind9-dnsutils_1%3a9.16.1-0ubuntu2.3_amd64.deb)
2020-08-31 10:09:03,634 DEBUG found pkg: bind9-dnsutils
2020-08-31 10:09:03,637 DEBUG No conffiles in deb /var/cache/apt/archives/bind9-dnsutils_1%3a9.16.1-0ubuntu2.3_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,637 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 1115016 DestFile:'/var/cache/apt/archives/bind9-libs_1%3a9.16.1-0ubuntu2.3_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/b/bind9/bind9-libs_9.16.1-0ubuntu2.3_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,637 DEBUG check_conffile_prompt(/var/cache/apt/archives/bind9-libs_1%3a9.16.1-0ubuntu2.3_amd64.deb)
2020-08-31 10:09:03,638 DEBUG found pkg: bind9-libs
2020-08-31 10:09:03,641 DEBUG No conffiles in deb /var/cache/apt/archives/bind9-libs_1%3a9.16.1-0ubuntu2.3_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,641 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 43008 DestFile:'/var/cache/apt/archives/bind9-host_1%3a9.16.1-0ubuntu2.3_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/b/bind9/bind9-host_9.16.1-0ubuntu2.3_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,641 DEBUG check_conffile_prompt(/var/cache/apt/archives/bind9-host_1%3a9.16.1-0ubuntu2.3_amd64.deb)
2020-08-31 10:09:03,641 DEBUG found pkg: bind9-host
2020-08-31 10:09:03,644 DEBUG No conffiles in deb /var/cache/apt/archives/bind9-host_1%3a9.16.1-0ubuntu2.3_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,644 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 9744 DestFile:'/var/cache/apt/archives/python3-problem-report_2.20.11-0ubuntu27.8_all.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/a/apport/python3-problem-report_2.20.11-0ubuntu27.8_all.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,644 DEBUG check_conffile_prompt(/var/cache/apt/archives/python3-problem-report_2.20.11-0ubuntu27.8_all.deb)
2020-08-31 10:09:03,667 DEBUG found pkg: python3-problem-report
2020-08-31 10:09:03,669 DEBUG No conffiles in deb /var/cache/apt/archives/python3-problem-report_2.20.11-0ubuntu27.8_all.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,669 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 84336 DestFile:'/var/cache/apt/archives/python3-apport_2.20.11-0ubuntu27.8_all.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/a/apport/python3-apport_2.20.11-0ubuntu27.8_all.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,669 DEBUG check_conffile_prompt(/var/cache/apt/archives/python3-apport_2.20.11-0ubuntu27.8_all.deb)
2020-08-31 10:09:03,674 DEBUG found pkg: python3-apport
2020-08-31 10:09:03,675 DEBUG No conffiles in deb /var/cache/apt/archives/python3-apport_2.20.11-0ubuntu27.8_all.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,675 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 128400 DestFile:'/var/cache/apt/archives/apport_2.20.11-0ubuntu27.8_all.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/a/apport/apport_2.20.11-0ubuntu27.8_all.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,676 DEBUG check_conffile_prompt(/var/cache/apt/archives/apport_2.20.11-0ubuntu27.8_all.deb)
2020-08-31 10:09:03,676 DEBUG found pkg: apport
2020-08-31 10:09:03,677 DEBUG conffile line: /etc/apport/blacklist.d/README.blacklist c2ed1eb9a17ec2550747b4960cf4b73c
2020-08-31 10:09:03,678 DEBUG current md5: c2ed1eb9a17ec2550747b4960cf4b73c
2020-08-31 10:09:03,678 DEBUG conffile line: /etc/apport/blacklist.d/apport 44503501302b80099552bac0204a45c1
2020-08-31 10:09:03,678 DEBUG current md5: 44503501302b80099552bac0204a45c1
2020-08-31 10:09:03,678 DEBUG conffile line: /etc/apport/crashdb.conf 4202dae3eccfa5bbb33a0a9acfcd3724
2020-08-31 10:09:03,678 DEBUG current md5: 4202dae3eccfa5bbb33a0a9acfcd3724
2020-08-31 10:09:03,678 DEBUG conffile line: /etc/bash_completion.d/apport_completion dfe766d9328bb5c895038b44185133f9
2020-08-31 10:09:03,679 DEBUG current md5: dfe766d9328bb5c895038b44185133f9
2020-08-31 10:09:03,679 DEBUG conffile line: /etc/cron.daily/apport df5d3bc9ab3a67b58156376318077304
2020-08-31 10:09:03,679 DEBUG current md5: df5d3bc9ab3a67b58156376318077304
2020-08-31 10:09:03,679 DEBUG conffile line: /etc/default/apport 3446c6cac185f44237f59786e006ebe4
2020-08-31 10:09:03,679 DEBUG current md5: 3446c6cac185f44237f59786e006ebe4
2020-08-31 10:09:03,679 DEBUG conffile line: /etc/init.d/apport f57e2de719f383ed276964881af116f8
2020-08-31 10:09:03,680 DEBUG current md5: f57e2de719f383ed276964881af116f8
2020-08-31 10:09:03,680 DEBUG conffile line: /etc/logrotate.d/apport fa54dab59ef899b48d5455c976008df4
2020-08-31 10:09:03,680 DEBUG current md5: fa54dab59ef899b48d5455c976008df4
2020-08-31 10:09:03,680 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 161428 DestFile:'/var/cache/apt/archives/curl_7.68.0-1ubuntu2.2_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.68.0-1ubuntu2.2_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,680 DEBUG check_conffile_prompt(/var/cache/apt/archives/curl_7.68.0-1ubuntu2.2_amd64.deb)
2020-08-31 10:09:03,681 DEBUG found pkg: curl
2020-08-31 10:09:03,683 DEBUG No conffiles in deb /var/cache/apt/archives/curl_7.68.0-1ubuntu2.2_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,684 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 233028 DestFile:'/var/cache/apt/archives/libcurl4_7.68.0-1ubuntu2.2_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/c/curl/libcurl4_7.68.0-1ubuntu2.2_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,684 DEBUG check_conffile_prompt(/var/cache/apt/archives/libcurl4_7.68.0-1ubuntu2.2_amd64.deb)
2020-08-31 10:09:03,685 DEBUG found pkg: libcurl4
2020-08-31 10:09:03,687 DEBUG No conffiles in deb /var/cache/apt/archives/libcurl4_7.68.0-1ubuntu2.2_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,687 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 230936 DestFile:'/var/cache/apt/archives/libcurl3-gnutls_7.68.0-1ubuntu2.2_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/c/curl/libcurl3-gnutls_7.68.0-1ubuntu2.2_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,688 DEBUG check_conffile_prompt(/var/cache/apt/archives/libcurl3-gnutls_7.68.0-1ubuntu2.2_amd64.deb)
2020-08-31 10:09:03,689 DEBUG found pkg: libcurl3-gnutls
2020-08-31 10:09:03,691 DEBUG No conffiles in deb /var/cache/apt/archives/libcurl3-gnutls_7.68.0-1ubuntu2.2_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,691 DEBUG <apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 291668 DestFile:'/var/cache/apt/archives/tmux_3.0a-2ubuntu0.1_amd64.deb' DescURI: 'http://ch.archive.ubuntu.com/ubuntu/pool/main/t/tmux/tmux_3.0a-2ubuntu0.1_amd64.deb' ID:0 ErrorText: ''>
2020-08-31 10:09:03,691 DEBUG check_conffile_prompt(/var/cache/apt/archives/tmux_3.0a-2ubuntu0.1_amd64.deb)
2020-08-31 10:09:03,694 DEBUG found pkg: tmux
2020-08-31 10:09:03,695 DEBUG No conffiles in deb /var/cache/apt/archives/tmux_3.0a-2ubuntu0.1_amd64.deb (There is no member named 'conffiles')
2020-08-31 10:09:03,695 DEBUG Packages blacklist due to conffile prompts: []
2020-08-31 10:09:03,695 DEBUG Configured to install on shutdown, so exiting now

根据上面的最后一行,无人值守升级已正确设置,以在关机时应用更新。

但过了一会儿sudo shutdown -h now,服务器立即断电。下次启动时,我看到的是:

18 updates can be installed immediately.
6 of these updates are security updates.
To see these additional updates run: apt list --upgradable

因此很明显,关机时没有任何更新......

有任何线索可以解释为什么这没有按预期进行吗?

相关内容