root@uu-lock-bail:~# ./unattended-upgrade --dry-run --verbose
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
Option --dry-run given, *not* performing real actions
Packages that will be upgraded: apport bind9-host curl dirmngr distro-info-data dnsutils file git git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv libbind9-160 libcurl3-gnutls libcurl4 libdns-export1100 libdns1100 libgcrypt20 libirs160 libisc-export169 libisc169 libisccc160 libisccfg160 liblwres160 libmagic-mgc libmagic1 libperl5.26 libpng16-16 libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libprocps6 libssl1.0.0 libssl1.1 openssl perl perl-base perl-modules-5.26 policykit-1 procps python3-apport python3-problem-report wget
Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
/usr/bin/dpkg --status-fd 9 --no-triggers --unpack --auto-deconfigure /var/cache/apt/archives/distro-info-data_0.37ubuntu0.1_all.deb
/usr/bin/dpkg --status-fd 9 --configure --pending
Exception happened during upgrade.
Traceback (most recent call last):
File "./unattended-upgrade", line 539, in cache_commit
res = cache.commit(install_progress=iprogress)
File "./unattended-upgrade", line 360, in __exit__
apt_pkg.pkgsystem_lock()
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?
Exception happened during upgrade.
NoneType: None
Installing the upgrades failed!
error message: 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?
dpkg returned a error! See /var/log/unattended-upgrades/unattended-upgrades-dpkg.log for details
root@uu-lock-bail:~# dpkg -l unattended-upgrades | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===================-==================-============-===========================================
# while sleep 0.1; do python3 -c 'import apt, apt_pkg, time; print(apt_pkg.pkgsystem_lock()); time.sleep(2)' ; done
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
...
Verified the fix with 1.1ubuntu1.18.04.5:
root@uu- lock-bail: ~# ./unattended- upgrade --dry-run --verbose a=bionic- security, o=UbuntuESM, a=bionic backend- 1-0 libpolkit- gobject- 1-0 libprocps6 libssl1.0.0 libssl1.1 openssl perl perl-base perl-modules-5.26 policykit-1 procps python3-apport python3- problem- report wget unattended- upgrades/ unattended- upgrades- dpkg.log apt/archives/ distro- info-data_ 0.37ubuntu0. 1_all.deb upgrade" , line 539, in cache_commit install_ progress= iprogress) upgrade" , line 360, in __exit__ pkg.pkgsystem_ lock() unattended- upgrades/ unattended- upgrades- dpkg.log for details lock-bail: ~# dpkg -l unattended-upgrades | cat Unknown/ Install/ Remove/ Purge/Hold Not/Inst/ Conf-files/ Unpacked/ halF-conf/ Half-inst/ trig-aWait/ Trig-pend /Reinst- required (Status,Err: uppercase=bad) ======= ======= ==-==== ======= ======= -====== ======- ======= ======= ======= ======= ======= ======= =
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: apport bind9-host curl dirmngr distro-info-data dnsutils file git git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv libbind9-160 libcurl3-gnutls libcurl4 libdns-export1100 libdns1100 libgcrypt20 libirs160 libisc-export169 libisc169 libisccc160 libisccfg160 liblwres160 libmagic-mgc libmagic1 libperl5.26 libpng16-16 libpolkit-agent-1-0 libpolkit-
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 --configure --pending
Exception happened during upgrade.
Traceback (most recent call last):
File "./unattended-
res = cache.commit(
File "./unattended-
apt_
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?
Exception happened during upgrade.
NoneType: None
Installing the upgrades failed!
error message: 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?
dpkg returned a error! See /var/log/
root@uu-
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
# while sleep 0.1; do python3 -c 'import apt, apt_pkg, time; print(apt_ pkg.pkgsystem_ lock()) ; time.sleep(2)' ; done
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
...