E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)

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

解决方法:输入以下命令

sudo rm /var/cache/apt/archives/lock

sudo rm /var/lib/dpkg/lock

之后再安装想装的包,即可解决

今天玩ubuntu的时候,在弄更新源的时候,突然出现以下错误:

[1]+ Stopped                 sudo apt-get update
[email protected]:~$ sudo apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the list directory

开始以为是权限不够,就是用 sudo apt-get update,发现还是报错,问题没有解决。于是上网搜索了一下,答案如下:

问题应该是之前那个更新被强制取消的问题,进程仍然还在。用这个命令查看一下:

ps -e | grep apt

显示结果如下:

6362 ? 00:00:00 apt

6934 ? 00:00:00 apt-get

7368 ? 00:00:00 synaptic

然后就执行

sudo killall apt

sudo killall apt-get

sudo killall synaptic

再次在终端里查看ps -e | grep apt 没有任何结果了

继续执行sudo apt-get update

OK!

原因:刚装好的Ubantu系统,内部缺少很多软件源,这时,系统会自动启动软件源更新进程“apt-get”,并且它会一直存活。由于它在运行时,会占用软件源更新时的系统锁(以下称“系统更新锁”,此锁文件在“/var/lib/apt/lists/”目录下),而当有新的apt-get进程生成时,就会因为得不到系统更新锁而出现"E: 无法获得锁 /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)"错误提示!因此,我们只要将原先的apt-get进程杀死,从新激活新的apt-get进程,就可以让新立德软件管理器正常工作了!

这时,你可以按一下步骤来解决:
1、输入以下命令:“ps -aux  > temp.txt”.敲回车确定。这时会有“warning”出现,但不予理会。
2、输入以下命令:“grep -n apt-get temp.txt”键入回车确定。而后从命令输出中找到 apt-get 进程的PID。
3、输入以下命令:“sudo kill <PID>”。
4、完成。

or

如果提示错误:E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) 
输入

sudo rm /var/lib/apt/lists/lock

即可

copy link:

http://blog.csdn.net/zyxlinux888/article/details/6358615

时间: 2024-09-30 06:45:09

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)的相关文章

ubuntu 报错E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unav E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process us

1.配置xshell,查看虚拟机中ubuntu中网络ip ifconfig 报错 Command 'ifconfig' not found, but can be installed with: sudo apt install net-tools 没有这个工具需要安装 net-tools 2.安装net-tools,报错 sudo apt install net-tools 注意:ubuntu 高版本,比如18..,都是apt,而不是apt-get 报错信息: E: Could not get

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarly unavailable)

1. 问题详细提示如下: E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is an other process using it? 2. 如何解决这种问题呢? 2.1 首先查看是否有apt-get这个程序在运行 ps aux|grep apt-get 2.2 如果发现存在这样的程序在运行那么就kill掉,否则执行2.3 2.3 直接删除锁文件 sudo rm /var/lib/dpkg/loc

linux 遇见错误Could not get lock /var/lib/dpkg/lock

通过终端安装程序sudo apt-get install xxx时出错: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? 出现这个问题可能是有另外一个程序正在运行,导致资源被锁不可用.而导致

ubuntu常见错误--Could not get lock /var/lib/dpkg/lock解决

通过终端安装程序sudo apt-get install xxx时出错:(或者卸载的时候) 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? 出现这个问题可能是有另外一个程序正在运行,导致资

【ubuntu 】常见错误--Could not get lock /var/lib/dpkg/lock

ubuntu 常见错误--Could not get lock /var/lib/dpkg/lock 通过终端安装程序sudo apt-get install xxx时出错: 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

(八)ubuntu安装软件提示:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)

question: [email protected]:/usr/src/Linux-headers-3.5.0-23-generic$ sudo apt-get install cheese [sudo] password for ubuntu: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)E: Unable to lock the administration di

E: Could not get lock /var/lib/dpkg/lock

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? 刚装好的ubuntu系统准备更新资源出现了一个这样的问题 出现这个问题的原因可能是有另外一个程序正在运行,导致资源被锁不可用.而导致资源被

ubuntu更新出错--Could not get lock /var/lib/dpkg/lock

ubuntu在vps上安装好后,通常第一个命令是更新系统软件.然而在运行的过程中,却出现这样的错误: 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-get的E: Could not get lock /var/lib/dpkg/lock方法

使用apt-get进行软件的install或update时,有时会出现以下提示信息: 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-get进程在活动. 解决办