Score:1

See terminal text. 'Waiting for cache lock' error. How to fix? I'm on Ubuntu 21.04

in flag
advait@advait-Bravo-15-A4DDR:~$ sudo apt install ubuntu-restricted-extras
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)      
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)      
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)      
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)      
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)      
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)  
Michal Przybylowicz avatar
eg flag
Another process `synaptic` is holding ownership of the lock file. Close the synaptic or kill it `sudo killall -9 synaptic` then re-run Your apt command. If that won't work and synaptic is already killed just remove the lock file `sudo rm /var/lib/dpkg/lock-frontend` and re-run apt.
guiverc avatar
cn flag
Check another workspace, or another window, you'll have started `synaptic` and caused the hold, and then forgotten about it.
Score:2
cn flag

Close synaptic package manager, and the "sudo apt install" command will automatically continue.

You cannot have two different applications that work with the APT package management system open at the same time.

Yes, I very frequently see the same messages as you ;)

in flag
This worked. I closed Synaptic and was able to complete the task.
Score:0
cn flag

This answer on Unix & Linux SE by Stéphane Chazelas has some useful commands:

If you want to kill processes based on their name or argument list, use pkill.

pkill regexp

Will kill all processes whose name matches the regexp extended regular expression.

pkill -f regexp

Will kill all processes whose list of arguments (including the first which usually contains the command name) concatenated with spaces matches the regexp.

in flag
Thanks for the suggestion but unfortunately I have no idea what "regexp" or a regular expression is. I'll have to research.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.