解决在ubuntu下安装git出现Unable to lock the administration directory (/var/lib/dpkg/)的问题

前端之家收集整理的这篇文章主要介绍了解决在ubuntu下安装git出现Unable to lock the administration directory (/var/lib/dpkg/)的问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_502_0@

在ubuntu16.04下安装git,出现以下问题:

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) 
E: Unable to lock the administration directory (/var/lib/dpkg/)

解决方法https://stackoverflow.com/questions/42899411/i-want-to-install-git-in-ubuntu-but-i-am-getting-error

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a

原因可能是已经打开了Synaptic 包管理器的GUI界面,同时想通过在终端输入sudo apt-get install安装软件。

猜你在找的Ubuntu相关文章