apt错误处理

**出错命令:一个普通的下载命令**

> sudo apt-get install htop      

**错误提示:**

> E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavialable)
> E: Unable to acquire the dpkg fronted lock (/var/lib/dpkg/lock-frontend), is another process using it?

**出现这个问题可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因可能是上次运行安装或更新时没有正常完成,才导致这个问题发生。**

**解决方法:删掉之前遗留下来的进程**

> $ ps -e | grep apt
> $ sudo kill -9 apt进程号
> $ sudo rm /var/lib/dpkg/lock
> $ sudo dpkg --configure -a
> $ sudo apt update 

 

posted @ 2022-01-28 15:08  roverqqq  阅读(185)  评论(0)    收藏  举报