问题背景
在安装软件包的时候出现如下错误
gyx@gyx-virtual-machine:~/Desktop$ sudo apt-get remove --purge llvm* libllvm* clang*
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 15472 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
解决办法:
sudo killall apt apt-get
当以上结果显示没有进程占用则进行下列
当以上结果显示没有进程占用,如图所示:
然后接下来运行以下命令,移除相关锁文件:
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
重新运行刚刚的命令,成功运行!