ubuntu中Could not get lock /var/lib/dpkg/lock解决方法

在Ubuntu中,有时候执行sudo apt-get install命令安装软件时,会出现以下的情况

E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

原因是apt还在运行

解决方法:

运行命令

$ sudo rm /var/lib/apt/lists/lock
$ sudo rm /var/cache/apt/archives/lock
    原文作者:Hi小胡
    原文地址: https://www.jianshu.com/p/b2a78da78a2b
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞