How do I clear a lock so as to allow an upgrade

Bret Busby bret at busby.net
Sat Nov 12 23:50:19 UTC 2022


Hello.

Having run
sudo apt update
when I try to run
sudo apt full-upgrade -y
I get the following error.

"
Sun Nov 13 07:33:46 bret at bret-OptiPlex-9030-AIO:~$sudo apt full-upgrade -y
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. 
It is held by process 48429 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. 
It is held by process 48429 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. 
It is held by process 48429 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. 
It is held by process 48429 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. 
It is held by process 48429 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. 
It is held by process 48429 (apt)
^Citing for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. 
It is held by process 48429 (apt)... 6s
Sun Nov 13 07:34:28 bret at bret-OptiPlex-9030-AIO:~$^C
"

How do I clear the lock, so as to allow the upgrade to proceed?

I have run
sudo kill 48429
and that did not fix the problem, and I have rebooted the system, and 
that did not clear the lock.

Also,

"
Sun Nov 13 07:44:11 bret at bret-OptiPlex-9030-AIO:~$sudo kill -9 48429
Sun Nov 13 07:44:23 bret at bret-OptiPlex-9030-AIO:~$ps -ax | grep 48429
   48429 pts/1    Z      0:00 [apt] <defunct>
  248169 pts/3    S+     0:00 grep --color=auto 48429
Sun Nov 13 07:44:28 bret at bret-OptiPlex-9030-AIO:~$
"

I assume that the 'Z' means zombie, as it is one of the undead, and 
cannot be killed (I understand that kill -9 is the penultimate kill 
command; the kill of last resort, like a nuke).

So, apart from reinstalling the system, to get to do an upgrade, how do 
I clear the lock?

Thank you in anticipation.
..
Bret Busby
Armadale
Western Australia
(UTC+0800)
.................





More information about the ubuntu-users mailing list