skip to Main Content

I was installing phpmyadmin following this tutorial.

I missed the warning in step 1 and I did not select Apache2. I exited the command line and when I try to start from the beginning I get this 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?

I’ve been searching for answers, but couldn’t find one that helps.
What should I do here?
Thanks

5

Answers


  1. Some of the running processes is still using the apt package manager. You can find the apt process using the following command:

    ps aux | grep apt
    

    and kill it:

    sudo kill -9 PID
    

    Don’t forget to replace PID with the actual process ID.

    Login or Signup to reply.
  2. Probably a background process is using/locked on the administrator directory. You could

    ps

    or

    ps | e

    to view the running processes and stop/kill the one using the dpkg.

    I ran into this error once after updating my Linux Mint Tara, and couldn’t use dpkg. I had to restart the whole system which worked fine.
    You could try it too, restarting.

    Login or Signup to reply.
  3. It mean something(Process) else is installing or removing software and has locked the apt database while it performs the action.(Probably The Software Center or The update Manager). The safest way is(without crashing your system) Reboot Ubuntu the Try to install phpmyadmin again.

    Login or Signup to reply.
  4. I had your same error messages [both of them] and I solved the issue running:

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

    as said in this post which explains that "the root cause is the lock file. Lock files are used to prevent two or more processes from using the same data. When apt or apt-commands are run, it creates lock files in a few places. When the previous apt command was not terminated properly, the lock files were not deleted and hence they prevent any new instances of apt/apt-get commands"

    Login or Signup to reply.
  5. Killing the process might not work always, because there could be no process involved at all!
    So, the best solution would be:

    sudo rm /var/lib/apt/lists/lock
    sudo rm /var/cache/apt/archives/lock
    sudo rm /var/lib/dpkg/lock*
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search