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

J. Paul Bissonnette jpaulb at eastlink.ca
Sun Nov 13 00:17:02 UTC 2022


On Sat, 12 Nov 2022 19:53:15 -0400
"J. Paul Bissonnette" <jpaulb at eastlink.ca> wrote:

> Is another program like synaptic running?
> 
> On Sun, 13 Nov 2022 07:50:19 +0800
> bret at busby.net wrote:
> 
> > 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)
> > .................
> > 
> > 
> 
> 
I am far from an expert. I tried what I thought, run synaptics and sudo
apt upgrade. the warning I received was
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend.
It is held by process 473795 (synaptic)
I think the name in brackets id the name of the process. If so in your
case it may have been apt.



More information about the ubuntu-users mailing list