1

I often try to install packages and I cannot since unattended-upgrades has locked files. Very often, it runs for more than 6 hours. Is that normal?

Given I have

$ 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";

I guess that is unexpected.

PS: I have now changed configuration as per this. Hopefully it will alleviate the issue.

EDIT #1: This may indicate that it is actually waiting (due to network issues. most likely due to proxy blocking) and retrying, while keeping the lock. I guess keeping the lock while just waiting is very unfortunate.

$ 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.)

As for the other issue/s, I did not find yet the cause, but I have updated libpython2.7 and libpython2.7-dev to see if this removes some of the retrying and delays.

$ 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
...

On a quick test, I could not get network speed, but it is usually not an issue

$ speedtest-cli --no-upload
Retrieving speedtest.net configuration...
Cannot retrieve speedtest configuration
ERROR: <urlopen error [Errno -2] Name or service not known>

Related: Limiting the time Unattended-Upgrade keeps the lock on `/var/lib/dpkg/`

7
  • It running for 6h is really unusual unless one has an incredibly slow net speed or bad mirror.
    – DK Bose
    Apr 13, 2020 at 16:17
  • What are the results of running speedtest-cli --no-upload command from the terminal?
    – karel
    Apr 13, 2020 at 16:32
  • @DKBose - Please see edited OP. Apr 13, 2020 at 17:00
  • @karel - Please see edited OP. Apr 13, 2020 at 17:00
  • 1
    Suggestion: You have held broken packages. Fix that first. After that, start looking at those network access failures. Disable unattended-upgrades until your system is ready to use it.
    – user535733
    Apr 13, 2020 at 20:09

0

You must log in to answer this question.

Browse other questions tagged .