Attaching log for shell "B", since it is quite long.
In the attached log it can be observed that the lock is still lost by u-u for small windows (due to python-apt losing it), but u-u then reacquires it, which is what the fix for u-u should do.
root@bb-uu:~# while sleep 0.3; do python3 -c 'import apt; import apt_pkg; print(apt_pkg.pkgsystem_lock())' ; done
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
Traceback (most recent call last):
File "<string>", line 1, in <module>
apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Traceback (most recent call last):
File "<string>", line 1, in <module>
apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Traceback (most recent call last):
File "<string>", line 1, in <module>
apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Traceback (most recent call last):
File "<string>", line 1, in <module>
apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Traceback (most recent call last):
File "<string>", line 1, in <module>
apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
^C
root@bb-uu:~# exit
Verified with 1.1ubuntu1.18.04.1:
Log from shell "A": xenial- test:~$ lxc exec bb-uu-fixed -- bash a=bionic- security, o=UbuntuESM, a=bionic unattended- upgrades/ unattended- upgrades- dpkg.log apt/archives/ libgcrypt20_ 1.8.1-4ubuntu1. 1_amd64. deb apt/archives/ libssl1. 0.0_1.0. 2n-1ubuntu5. 1_amd64. deb apt/archives/ libssl1. 1_1.1.0g- 2ubuntu4. 1_amd64. deb apt/archives/ openssl_ 1.1.0g- 2ubuntu4. 1_amd64. deb
rbalint@
root@bb-uu-fixed:~# unattended-upgrade --dry-run --verbose
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,
Option --dry-run given, *not* performing real actions
Packages that will be upgraded: libgcrypt20 libssl1.0.0 libssl1.1 openssl
Writing dpkg log to /var/log/
/usr/bin/dpkg --status-fd 9 --no-triggers --unpack --auto-deconfigure /var/cache/
/usr/bin/dpkg --status-fd 9 --no-triggers --configure libgcrypt20:amd64
/usr/bin/dpkg --status-fd 9 --configure --pending
Preconfiguring packages ...
/usr/bin/dpkg --status-fd 9 --no-triggers --unpack --auto-deconfigure /var/cache/
/usr/bin/dpkg --status-fd 9 --configure --pending
Preconfiguring packages ...
/usr/bin/dpkg --status-fd 9 --no-triggers --unpack --auto-deconfigure /var/cache/
/usr/bin/dpkg --status-fd 9 --configure --pending
/usr/bin/dpkg --status-fd 9 --no-triggers --unpack --auto-deconfigure /var/cache/
/usr/bin/dpkg --status-fd 9 --configure --pending
All upgrades installed
Attaching log for shell "B", since it is quite long.
In the attached log it can be observed that the lock is still lost by u-u for small windows (due to python-apt losing it), but u-u then reacquires it, which is what the fix for u-u should do.
Unfixed unattended-upgrades 1.1ubuntu1, shell "B":
root@bb-uu:~# while sleep 0.3; do python3 -c 'import apt; import apt_pkg; print(apt_ pkg.pkgsystem_ lock()) ' ; done
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
Traceback (most recent call last):
File "<string>", line 1, in <module>
apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Traceback (most recent call last):
File "<string>", line 1, in <module>
apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Traceback (most recent call last):
File "<string>", line 1, in <module>
apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Traceback (most recent call last):
File "<string>", line 1, in <module>
apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Traceback (most recent call last):
File "<string>", line 1, in <module>
apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
^C
root@bb-uu:~# exit
In the unfixed version u-u just loses the lock.