Puppet: Error: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

0 votes
While trying to install puppet 6.7( puppet server) on Linux 18.04, I get the following error. How do I resolve it?
Aug 5, 2019 in Puppet by Karan
• 9,340 points

1 answer to this question.

0 votes

I faced the same error while i was trying to install puppet server. Here's what i did:

To fix the problem, all you need to do is to remove the lock files. But before you do that, it would be a good idea to stop any process that is using the lock files.

Use the lsof command to get the process ID of the process holding the lock files. 

Run these commands one by one.

lsof /var/lib/dpkg/lock
lsof /var/lib/apt/lists/lock
lsof /var/cache/apt/archives/lock

It’s possible that the commands don’t return anything, or return just one number. If they do return at least one number, use the number(s) and kill the processes like this (replace the PID with the numbers you got from the above commands):

sudo kill -9 PID

You can now safely remove the lock files using the commands below:

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

After that, reconfigure the packages:

sudo dpkg --configure -a

Now if you run the sudo apt update command, everything should be fine.

This worked for me!

answered Aug 5, 2019 by Sirajul
• 48,810 points

Related Questions In Puppet

0 votes
1 answer

“dpkg: error: dpkg frontend is locked by another process”

First, find out the id of the ...READ MORE

answered Aug 5, 2019 in Puppet by Sirajul
• 48,810 points
0 votes
1 answer

Error: Puppet agent lock file exist - skipping (/var/lib/puppet/state/agent_catalog_run.lock exists

This usually happens when you have already ...READ MORE

answered Sep 18, 2019 in Puppet by Sirajul
• 48,810 points
+1 vote
0 answers

I am running a Jenkins job to sign the certificate by puppet master but it is failing

I am using AWS EC2 VM as ...READ MORE

Jan 12 in Puppet by Madhusudan
• 130 points
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,400 points
0 votes
1 answer