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 in Puppet by Karan
• 6,650 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 by Sirajul
• 40,980 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 in Puppet by Sirajul
• 40,980 points
0 votes
1 answer
0 votes
1 answer
+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,380 points
0 votes
1 answer