I encountered a problem when installing vim on the Ubuntu system:
root@ubuntu:/# vimThe program 'vim' can be found in the following packages: * vim * vim-gnome * vim-tiny * vim-athena * vim-athena-py2 * vim-gnome-py2 * vim-gtk * vim-gtk-py2 * vim-gtk3 * vim-gtk3-py2 * vim-nox * vim-nox-py2 Try: apt install <selected package>root@ubuntu:/# apt install vimE: 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?root@ubuntu:/#
This problem may occur because another program is running, causing the resource to be locked and unavailable. The reason why the resources are locked may be that the last installation or update was not completed normally, and this situation occurs. The solution is actually very simple:
Enter the following two commands in the terminal:
root@ubuntu:/# sudo rm /var/cache/apt/archives/lockroot@ubuntu:/# sudo rm /var/lib/dpkg/lock
After execution, you can install the vim text editor again.
The above is the detailed content of Sharing of common Linux errors and solutions. For more information, please follow other related articles on the PHP Chinese website!