Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
无人值守升级期间,CPU 使用率达 100%,持续 4 小时
例子:
$ unattended-upgrade --dry-run --debug
2019-02-16 10:34:46,087 INFO Enabled logging to syslog via daemon facility
2019-02-16 10:34:46,087 INFO Initial blacklisted packages:
2019-02-16 10:34:46,088 INFO Initial whitelisted packages:
2019-02-16 10:34:46,088 INFO Starting unattended upgrades script
2019-02-16 10:34:46,088 INFO Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
2019-02-16 10:34:56,044 INFO Enabled logging to syslog via daemon facility
2019-02-16 10:34:56,045 INFO Initial blacklisted packages:
2019-02-16 10:34:56,045 INFO Initial whitelisted packages:
2019-02-16 10:34:56,045 INFO Starting unattended upgrades script
*2019-02-16 10:34:56,046 INFO Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
2019-02-16 10:34:56,290 DEBUG Using (^linux-image|^linux-headers|^linux-image-extra|^linux-modules|^linux-modules-extra|^linux-signed-image|^kfreebsd-image|^kfreebsd-headers|^gnumach-image|^.*-modules|^.*-kernel|^linux-backports-modules-
.*|^linux-modules-.*|^linux-tools|^linux-cloud-tools) regexp to find kernel packages
2019-02-16 10:34:56,294 DEBUG Using (^linux-image.*4.15.0-45-generic|^linux-headers.*4.15.0-45-generic|^linux-image-extra.*4.15.0-45-generic|^linux-modules.*4.15.0-45-generic|^linux-modules-extra.*4.15.0-45-generic|^linux-signed-image.*4
.15.0-45-generic|^kfreebsd-image.*4.15.0-45-generic|^kfreebsd-headers.*4.15.0-45-generic|^gnumach-image.*4.15.0-45-generic|4.15.0-45-generic.*-modules|4.15.0-45-generic.*-kernel|^linux-backports-modules-.*.*4.15.0-45-generic|^linux-modul
es-.*.*4.15.0-45-generic|^linux-tools.*4.15.0-45-generic|^linux-cloud-tools.*4.15.0-45-generic) regexp to find running kernel packages
2019-02-16 10:34:57,345 DEBUG pkgs that look like they should be upgraded:
2019-02-16 10:37:17,591 INFO Enabled logging to syslog via daemon facility
2019-02-16 10:37:17,592 INFO Initial blacklisted packages:
2019-02-16 10:37:17,593 INFO Initial whitelisted packages:
2019-02-16 10:37:17,593 INFO Starting unattended upgrades script
2019-02-16 10:37:17,593 INFO Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
2019-02-16 10:37:17,836 DEBUG Using (^linux-image|^linux-headers|^linux-image-extra|^linux-modules|^linux-modules-extra|^linux-signed-image|^kfreebsd-image|^kfreebsd-headers|^gnumach-image|^.*-modules|^.*-kernel|^linux-backports-modules-
.*|^linux-modules-.*|^linux-tools|^linux-cloud-tools) regexp to find kernel packages
2019-02-16 10:37:17,840 DEBUG Using (^linux-image.*4.15.0-45-generic|^linux-headers.*4.15.0-45-generic|^linux-image-extra.*4.15.0-45-generic|^linux-modules.*4.15.0-45-generic|^linux-modules-extra.*4.15.0-45-generic|^linux-signed-image.*4
.15.0-45-generic|^kfreebsd-image.*4.15.0-45-generic|^kfreebsd-headers.*4.15.0-45-generic|^gnumach-image.*4.15.0-45-generic|4.15.0-45-generic.*-modules|4.15.0-45-generic.*-kernel|^linux-backports-modules-.*.*4.15.0-45-generic|^linux-modul
es-.*.*4.15.0-45-generic|^linux-tools.*4.15.0-45-generic|^linux-cloud-tools.*4.15.0-45-generic) regexp to find running kernel packages
2019-02-16 10:37:18,903 DEBUG pkgs that look like they should be upgraded:
2019-02-16 14:22:00,768 DEBUG fetch.run() result: 0
2019-02-16 14:22:00,769 DEBUG blacklist: []
2019-02-16 14:22:00,769 DEBUG whitelist: []
2019-02-16 14:22:00,771 INFO No packages found that can be upgraded unattended and no pending auto-removals
2019-02-16 10:37:18,903 DEBUG 包看起来应该升级:
2019-02-16 14:22:00,768 DEBUG fetch.run() 结果:0
这是一个“手动运行”,但在自动更新期间也会出现此问题:
3541 ? Ss 0:00 /bin/sh /usr/lib/apt/apt.systemd.daily update
3546 ? S 0:00 \_ /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held update
4072 ? Rl 158:20 \_ /usr/bin/python3 /usr/bin/unattended-upgrade --download-only
更新 1
今天有更新,但这是结果(“顶部”):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
23271 root 20 0 269328 181084 49932 R 100.0 4.5 0:22.21 unattended-upgr
仍然在这里等待几个小时,CPU 为 100%……
# unattended-upgrade --dry-run --debug
Enabled logging to syslog via daemon facility
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
Using (^linux-image|^linux-headers|^linux-image-extra|^linux-modules|^linux-modules-extra|^linux-signed-image|^kfreebsd-image|^kfreebsd-headers|^gnumach-image|^.*-modules|^.*-kernel|^linux-backports-modules-.*|^linux-modules-.*|^linux-tools|^linux-cloud-tools) regexp to find kernel packages
Using (^linux-image.*4.15.0-45-generic|^linux-headers.*4.15.0-45-generic|^linux-image-extra.*4.15.0-45-generic|^linux-modules.*4.15.0-45-generic|^linux-modules-extra.*4.15.0-45-generic|^linux-signed-image.*4.15.0-45-generic|^kfreebsd-image.*4.15.0-45-generic|^kfreebsd-headers.*4.15.0-45-generic|^gnumach-image.*4.15.0-45-generic|4.15.0-45-generic.*-modules|4.15.0-45-generic.*-kernel|^linux-backports-modules-.*.*4.15.0-45-generic|^linux-modules-.*.*4.15.0-45-generic|^linux-tools.*4.15.0-45-generic|^linux-cloud-tools.*4.15.0-45-generic) regexp to find running kernel packages
Checking: libnss-systemd ([<Origin component:'main' archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'bionic-security' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: libpam-systemd ([<Origin component:'main' archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'bionic-security' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: libpci3 ([<Origin component:'main' archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
adjusting candidate version: libpci3=1:3.5.2-1ubuntu1
Checking: libsystemd0 ([<Origin component:'main' archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'bionic-security' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: libudev1 ([<Origin component:'main' archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'bionic-security' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: pciutils ([<Origin component:'main' archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
adjusting candidate version: pciutils=1:3.5.2-1ubuntu1
Checking: systemd ([<Origin component:'main' archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'bionic-security' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: systemd-sysv ([<Origin component:'main' archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'bionic-security' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: udev ([<Origin component:'main' archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'bionic-security' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
pkgs that look like they should be upgraded: libnss-systemd
libpam-systemd
libsystemd0
libudev1
systemd
systemd-sysv
udev
我仍然认为 Ubuntu 是最差的 Linux 发行版。
更新 2
我发现了这个问题!只有当我有许多路由表时才会出现此问题。无法解释,但在所有安装中均可重现。
答案1
考虑关闭 APT 中的无人值守升级。通过执行以下操作grep -R Unattended /etc/apt
并查找以下内容来禁用它:
APT::Periodic::Unattended-Upgrade "1";
然后,将 1 改为 0(禁用)。然后您可以尝试重新启动无人值守升级服务(systemctl restart unattended-upgrades.service
),但有时重新启动整个机器实际上会更快。
答案2
但 2.8 版却出现了这种情况。我找到了这个命令来禁用此功能:
sudo dpkg-reconfigure unattended-upgrades
来源: https://ostechnix.com/how-to-disable-unattended-upgrades-on-ubuntu/
答案3
可能是Ubuntu 18.04.2 LTS导致问题。尝试将其升级到Ubuntu 18.04.6 LTS使用 apt-get upgrade 和 apt-get dist-upgrade。
答案4
这是一个已知错误v1.1 unattended-upgrades
(又名 1.1ubuntu1.18.04.11)。升级到 v1.4(又名 1.1ubuntu1.18.04.14):
sudo apt-get update && sudo apt-get install --only-upgrade unattended-upgrades
您可以使用以下方式检查当前版本:
dpkg -s unattended-upgrades | grep '^Version:' | cut -d' ' -f2