【ubuntu 出现Could not get lock /var/lib/dpkg/lock-frontend. It is held by process XXXX.的解决方法】
问题复现:
liyang@ubuntu:~$ sudo apt install git
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held ^C process 3305 (unattended-upgr)... 9s

按照如下命令输入到终端即可解决问题:
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*
sudo dpkg --configure -a
sudo apt update

问题成功解决:

本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
