Today, after dealing with the problem, you have nothing to do, and intend to practice shell scripting in Ubuntu in the virtual machine.
Helpless, virtual machine system installed only VI, this editing software for us or is not accustomed to, so intends to install vim. All right, gossip a little.
Install Vim:
1. I am the virtual machine system to avoid trouble, directly switch the root user. Input: Apt-get install VIM-GTK command can be installed, if not the root user, add sudo in front of the command, namely: sudo apt-get install VIM-GTK can be installed Vim tool.
2. However, the installation of the time to report a mistake, the error content is as follows:
E: Unable to get lock/var/lib/dpkg/lock-open (11: Resource temporarily unavailable)
E: Unable to lock the management directory (/var/lib/dpkg/), is there any other process that is consuming it?
Check a lot of information, the hint is also very clear, the reason may be the last time I directly in the VM cut off the power source has been occupied has not been released, so still should pay attention to standardize operations, develop good habits, even if the virtual machine is also the case.
Workaround: I'm using a direct kill-taking process.
The command is as follows:
sudo rm/var/cache/apt/archives/locksudo rm/var/lib/dpkg/lock also removes the sudo keyword if it is the root user.
Unable to get lock/var/lib/dpkg/lock-open (11: Resource temporarily unavailable) Ubuntu installation vim and error handling encountered