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

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

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

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

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

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

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

原文链接:https://www.f2er.com/ubuntu/350185.html

猜你在找的Ubuntu相关文章