Comment 6 for bug 1794053

Julian Andres Klode (juliank) wrote :

bionic (1.6.3ubuntu0.1 -> 1.6.6):

root@dashing-panda:~# python3 a.py
total 0
[...]
lrwx------ 1 root root 64 Oct 18 12:07 3 -> /var/lib/dpkg/lock
l-wx------ 1 root root 64 Oct 18 12:07 6 -> 'pipe:[27578280]'
Reading package lists... Done
Building dependency tree
Reading state information... Done
total 0
[...]
l-wx------ 1 root root 64 Oct 18 12:07 6 -> 'pipe:[27578280]'
Traceback (most recent call last):
  File "a.py", line 13, in <module>
    apt_pkg.pkgsystem_unlock()
apt_pkg.Error: E:Not locked
[...]

=> We can see that the cache was already unlocked when it should not have been

root@dashing-panda:~# apt install libapt-pkg5.0
[...]
Unpacking libapt-pkg5.0:amd64 (1.6.6) over (1.6.3ubuntu0.1) ...
[...]
root@dashing-panda:~# python3 a.py
total 0
[...]
lrwx------ 1 root root 64 Oct 18 12:08 3 -> /var/lib/dpkg/lock-frontend
lrwx------ 1 root root 64 Oct 18 12:08 4 -> /var/lib/dpkg/lock
l-wx------ 1 root root 64 Oct 18 12:08 6 -> 'pipe:[27578280]'
Reading package lists... Done
Building dependency tree
Reading state information... Done
total 0
[...]
lrwx------ 1 root root 64 Oct 18 12:08 3 -> /var/lib/dpkg/lock-frontend
lrwx------ 1 root root 64 Oct 18 12:08 4 -> /var/lib/dpkg/lock
l-wx------ 1 root root 64 Oct 18 12:08 6 -> 'pipe:[27578280]'
root@dashing-panda:~#

=> script worked fine, we see that the lock is still open in the second ls, and there are no error messages