SparkyLinux Forums

Software & hardware support => Newbie questions => Topic started by: 7ua on December 27, 2021, 04:00:44 PM

Title: [SOLVED] Error: E: Could not get lock /var/lib/dpkg/lock-frontend
Post by: 7ua on December 27, 2021, 04:00:44 PM
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!  :(
Title: Re: Error: E: Could not get lock /var/lib/dpkg/lock-frontend
Post by: 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.



Title: Re: Error: E: Could not get lock /var/lib/dpkg/lock-frontend
Post by: 7ua on December 27, 2021, 10:54:28 PM
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?
Title: Re: Error: E: Could not get lock /var/lib/dpkg/lock-frontend
Post by: pewex on December 28, 2021, 01:14:40 PM
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/
Title: Re: Error: E: Could not get lock /var/lib/dpkg/lock-frontend
Post by: 7ua on December 28, 2021, 04:24:22 PM
 :) 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.
Title: Re: Error: E: Could not get lock /var/lib/dpkg/lock-frontend
Post by: 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.

Title: Re: Error: E: Could not get lock /var/lib/dpkg/lock-frontend
Post by: 7ua on December 28, 2021, 06:02:17 PM
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.
Title: Re: [SOLVED] Error: E: Could not get lock /var/lib/dpkg/lock-frontend
Post by: pewex on December 29, 2021, 07:24:32 AM
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).