0

I can't install any thing using

apt-get install

It gives this 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), its another process using it

I tried

dpkg --configure -a 
dpkg: error: dpkg status database is locked by another process.

dpkg --configure -a --force-congnew dpkg: error: dpkg status database is locked by another process.

Although I have shut down and restart the system to kill all other hidden process but do not know how to fix it.

I am using all these commands as a super user.

Ash
  • 11

1 Answers1

2

Remove broken locks

  1. Be sure any process is still running associated with these locks:

    sudo lsof /var/lib/dpkg/lock

    sudo lsof /var/lib/apt/lists/lock

    sudo lsof /var/cache/apt/archives/lock

If all of these commands output is empty, you can proceed.

  1. Remove any locks you find in these locations:

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

    sudo rm /var/cache/apt/archives/lock

  2. sudo dpkg --configure -a

  3. Try with sudo apt-get install again.

You should have superuser privileges to run those commands.