This question already has an answer here:
I got the the following error output when trying to install some package:
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?
So I ran
sudo rm /var/lib/apt/lists/lock sudo rm /var/cache/apt/archives/lock sudo dpkg --configure -a
Yet that last command returned
dpkg: error: dpkg status database is locked by another process
How can I solve this and install packages again?