Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum https://forum.linuxiarze.pl

[SOLVED] Error: E: Could not get lock /var/lib/dpkg/lock-frontend

Started by 7ua, December 27, 2021, 04:00:44 PM

Previous topic - Next topic

7ua

When trying to install any package, I get the following error   :-\ :
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Please help!  :(
Always wanting to help. +100%

pewex

It seems that another process is using /var/lib/dpkg/lock.
Google shows a few ways to fix it.




7ua

Quote from: pewex on December 27, 2021, 06:34:04 PM
It seems that another process is using /var/lib/dpkg/lock.
Google shows a few ways to fix it.
So, what should I do?
Always wanting to help. +100%

pewex

I'm newbie too, so I'm not sure if I'm right.
Maybe, first read this:
https://www.maketecheasier.com/unable-to-lock-error-ubuntu/

7ua

 :) Found a working solution. Source: https://askubuntu.com/questions/1109982/e-could-not-get-lock-var-lib-dpkg-lock-frontend-open-11-resource-temporari
This error may mean the system is updating or some other package manager is being used.
1. Firstly Try running sudo killall apt apt-get

2.If it still dose not work remove the lock files. like this:
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*

then reconfigure
sudo dpkg --configure -a
Lastly
sudo apt update
The no. 2 solution worked for me.
Always wanting to help. +100%

pewex

Great! that You have found right resolve.
Quote from: 7ua on December 28, 2021, 04:24:22 PM
The no. 2 solution worked for me.

Maybe the solution no.1 ('sudo killall apt apt-get') did not work because another program
(for example: Synaptic) or process was locking (one of) these files which You removed by 'rm' command.
It seems that apt or apt-get program wasn't the reason of the problem.


7ua

Quote from: pewex on December 28, 2021, 05:08:13 PM
Great! that You have found right resolve.
Quote from: 7ua on December 28, 2021, 04:24:22 PM
The no. 2 solution worked for me.

Maybe the solution no.1 ('sudo killall apt apt-get') did not work because another program
(for example: Synaptic) or process was locking (one of) these files which You removed by 'rm' command.
It seems that apt or apt-get program wasn't the reason of the problem.

The purpose of sudo killall apt apt-get was that if any other package manager was being used it would be closed, and i could install my package, although i do think you are right that it wasnt apt or apt-get that was causing the error, i think it might have been an auto update.
Always wanting to help. +100%

pewex

Try this command:
ps aux | grep -i apt
It should show You a list of other "apt" running programs or processes.
(-i ignores letter/word case).

View the most recent posts on the forum