Score:-1

DIFFERENT PROCCESS EVERY TIME Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend

tr flag

I'm having this error

Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 332998

Now, if i do

sudo kill 332998

I will get the same problem but with a different process number.

I already tried some of the answers with the same name "Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend." but nothing works.

like:

sudo rm /var/lib/dpkg/lock-frontend
sudo lsof /var/lib/dpkg/lock
sudo lsof /var/lib/apt/lists/lock
sudo lsof /var/cache/apt/archives/lock
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo apt install -f
sudo dpkg --configure -a
sudo apt-purge unattended-upgrades

or (this gives me a message saying "Apt-get not found")

sudo killall apt apt-get

Thanks

Update:

Solved

sudo apt autoclean
user535733 avatar
cn flag
A respawned process after you kill it suggests that the other package manager is still working, and that killing it was perhaps a very bad idea. Rather than try to force the system, investigate to determine what's really going on. For example, determine what application or command is that killed/respawned process. Your logs in /var/log/apt and timestamps in /var/log/apt/periodoc are also rich sources of additional useful information about what might be happening.
N0rbert avatar
zw flag
Does this answer your question? [What process created the /var/lib/dpkg/lock-frontend file in Ubuntu?](https://askubuntu.com/questions/1114678/what-process-created-the-var-lib-dpkg-lock-frontend-file-in-ubuntu)
bac0n avatar
cn flag
you can list locks with `lslocks`
tr flag
Did not work, but thanks
Someone avatar
my flag
`sudo kill -9 $(ps -x | egrep "apt|dpkg")`
tr flag
Well, after 2 full days looking for an answer, this is what worked for me : sudo apt autoclean... i really don't know why, so i'm not going to put it as an answer, just a comment
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.