1. 程式人生 > >解決在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 lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) 
E: Unable to lock the administration directory (/var/lib/dpkg/)
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安裝軟體。