當運行sudo apt-get install/update/其餘命令時,會出現以下提示:npm
E: 沒法得到鎖 /var/lib/dpkg/lock-frontend - open (11: 資源暫時不可用) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
本人出現的現象以下:ubuntu
fanbi@ubuntu:~$/ sudo apt install npm E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
出現這個問題的緣由多是:bash
在ubuntu系統的termial下,用apt-get install 安裝軟件的時候,若是在未完成下載的狀況下將terminal close。此時 apt-get進程可能沒有結束。結果,若是再次運行apt-get install 命令安裝軟件時,出現如上錯誤。即有另外一個程序正在佔用apt-get install進程,因爲它在運行時,會佔用軟件源更新時的系統鎖(簡稱‘系統更新鎖’),此時資源被鎖。frontend
因此,第一種方法,咱們只須要殺死以前的進程,釋放系統鎖就能夠了:ui
ps -e|grep apt-get
顯示.net
6965 ? 00:00:01 apt-get
而後執行blog
sudo kill 6965
第二種方法,強制解鎖進程
sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock
————————————————
版權聲明:本文爲CSDN博主「CLAY-Z」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處連接及本聲明。
原文連接:https://blog.csdn.net/qq_38019633/article/details/84024309資源