![无人值守升级持续数小时](https://linux22.com/image/1068079/%E6%97%A0%E4%BA%BA%E5%80%BC%E5%AE%88%E5%8D%87%E7%BA%A7%E6%8C%81%E7%BB%AD%E6%95%B0%E5%B0%8F%E6%97%B6.png)
我经常尝试安装软件包,但由于文件被锁定而无法安装unattended-upgrades
。通常,安装过程要运行 6 个小时以上。
这正常吗?
鉴于我有
$ cat /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
$ cat /etc/apt/apt.conf.d/10periodic
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
我想这是出乎意料的。
PS:我现在已按照更改了配置这。希望它能够缓解这个问题。
编辑#1:这可能表明它实际上正在等待(由于网络问题。很可能是由于代理阻塞)并重试,同时保持锁定。我猜在等待的同时保持锁定是非常不幸的。
$ cat /var/log/unattended-upgrades/unattended-upgrades.log | grep "2020-04-13"
2020-04-13 06:10:49,892 INFO Initial blacklisted packages:
2020-04-13 06:10:49,894 INFO Initial whitelisted packages:
2020-04-13 06:10:49,894 INFO Starting unattended upgrades script
2020-04-13 06:10:49,895 INFO Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
2020-04-13 06:25:16,404 WARNING package libpython2.7 upgradable but fails to be marked for upgrade (E:Unable to correct problems, you have held broken packages.)
2020-04-13 06:25:21,128 WARNING package libpython2.7 upgradable but fails to be marked for upgrade (E:Unable to correct problems, you have held broken packages.)
2020-04-13 06:46:57,101 WARNING package libpython2.7-dev upgradable but fails to be marked for upgrade (E:Unable to correct problems, you have held broken packages.)
2020-04-13 06:47:02,113 WARNING package libpython2.7-dev upgradable but fails to be marked for upgrade (E:Unable to correct problems, you have held broken packages.)
2020-04-13 08:29:08,908 ERROR An error occurred: 403 URLBlockDownload [IP: XXXXXXXX]
2020-04-13 08:29:08,909 ERROR The URI http://security.ubuntu.com/ubuntu/pool/main/d/db5.3/libdb5.3-java_5.3.28-13.1ubuntu1.1_all.deb failed to download, aborting
2020-04-13 08:29:24,965 INFO Initial blacklisted packages:
2020-04-13 08:29:24,966 INFO Initial whitelisted packages:
2020-04-13 08:29:24,966 INFO Starting unattended upgrades script
2020-04-13 08:29:24,967 INFO Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
2020-04-13 08:43:57,555 WARNING package libpython2.7 upgradable but fails to be marked for upgrade (E:Unable to correct problems, you have held broken packages.)
2020-04-13 08:44:02,297 WARNING package libpython2.7 upgradable but fails to be marked for upgrade (E:Unable to correct problems, you have held broken packages.)
2020-04-13 09:05:46,548 WARNING package libpython2.7-dev upgradable but fails to be marked for upgrade (E:Unable to correct problems, you have held broken packages.)
2020-04-13 09:05:51,561 WARNING package libpython2.7-dev upgradable but fails to be marked for upgrade (E:Unable to correct problems, you have held broken packages.)
至于其他问题,我还没有找到原因,但我已经更新libpython2.7
并libpython2.7-dev
查看这是否可以消除一些重试和延迟。
$ sudo apt-get install libpython2.7
...
The following additional packages will be installed:
libpython2.7-dev libpython2.7-minimal libpython2.7-stdlib python2.7 python2.7-dev python2.7-minimal
Suggested packages:
python2.7-doc
The following packages will be upgraded:
libpython2.7 libpython2.7-dev libpython2.7-minimal libpython2.7-stdlib python2.7 python2.7-dev python2.7-minimal
...
在快速测试中,我无法获得网络速度,但这通常不是问题
$ speedtest-cli --no-upload
Retrieving speedtest.net configuration...
Cannot retrieve speedtest configuration
ERROR: <urlopen error [Errno -2] Name or service not known>