Unable to lock the administration directory (/var/lib/dpkg/)-Ubuntu

Sometimes, we get an error when we are trying to use apt-get in Ubuntu–>

IMG-9870

Error-

E: 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?

You can delete the lock file using this commands:

# sudo rm /var/lib/apt/lists/lock

This line will delete your lock, You may also need to delete the lock file in the cache directory

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

After that, try again apt-get and you will be able to access it.

17 thoughts on “Unable to lock the administration directory (/var/lib/dpkg/)-Ubuntu

    1. this is a sign that something else is installing or removing software and has locked the apt database while it performs the actions.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s