If you are trying to install some package on ubuntu and by some means, in middle of the installation, some unexpected things happens causing installation to abort in the middle, in similar situation if you try to install the same package later on, you may see an error like below,
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?
If you see the lock file using “file /var/lib/dpkg/lock” command, its an empty file, but used as a lock to avoid multiple installations simultaneously.
Solution : To remove this error, we need to manually remove this file as,
$ sudo rm -rf /var/lib/dpkg/lock
Now, if you try to install the same or any other package again, you will not see the above error and installation happens successfully.