ubuntu1804 安裝軟件提示E: Could not get lock /var/lib/dpkg/lock-frontend

剛裝好系統,想安裝一個軟件,居然報錯,提示其他人正在安裝。

abhishek@nuc:~$ sudo apt install grub-customizer 
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?

接下來得找出來是誰在安裝軟件

abhishek@nuc:~$ ps aux | grep -i apt
root      1464  0.0  0.0   4624   772 ?        Ss   19:08   0:00 /bin/sh /usr/lib/apt/apt.systemd.daily update
root      1484  0.0  0.0   4624  1676 ?        S    19:08   0:00 /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held update
_apt      2836  0.8  0.1  96912  9432 ?        S    19:09   0:03 /usr/lib/apt/methods/http
abhishek  6172  0.0  0.0  21532  1152 pts/1    S+   19:16   0:00 grep --color=auto -i apt

元兇找到:apt.systemd.daily

這個是檢查更新的服務,禁用掉即可。

sudo systemctl disable apt-daily.timer 
sudo systemctl disable apt-daily-upgrade.timer
sudo reboot
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章