Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) 解决办法
1:我遇到的问题:
在开机运行apt install vim 命令的时候,如下报错:

2:参考博客:
在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?
3:问题原因:主要是因为apt还在运行。
4:解决方案:杀死所有的apt进程。
1:查找所有apt相关的进程,并用命令杀死。

root@ubuntu:~# ps afx|grep apt
3284 pts/0 S+ 0:00 \_ grep --color=auto apt
2869 ? Ss 0:00 /bin/sh /usr/lib/apt/apt.systemd.daily install
2873 ? S 0:00 \_ /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held install root@ubuntu:~# sudo kill -9 2873
root@ubuntu:~# sudo kill -9 2869

2:删除锁定文件
锁定的文件会阻止 Linux 系统中某些文件或者数据的访问,这个概念也存在于 Windows 或者其他的操作系统中。
一旦你运行了 apt-get 或者 apt 命令,锁定文件将会创建于 /var/lib/apt/lists/、/var/lib/dpkg/、/var/cache/apt/archives/ 中。
这有助于运行中的 apt-get 或者 apt 进程能够避免被其它需要使用相同文件的用户或者系统进程所打断。当该进程执行完毕后,锁定文件将会删除。
所以:
1:移除对应目录下的锁文件:
2:强制重新配置软件包:
3:更新软件包源文件:
root@ubuntu:~# rm /var/lib/dpkg/lock
root@ubuntu:~# dpkg --configure -a
root@ubuntu:~# apt update
3:问题解决,执行apt install 命令成功。
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: su ...
- E: could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporary unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is an other process using it
1. 问题详细提示如下: E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarly unava ...
- E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarly unavailable)
1. 问题详细提示如下: E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarly unava ...
- 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 ...
- ubuntu常见错误--could not get lock /var/lib/dpkg/lock -open
最近研究ubuntu,用apt-get命令安装一些软件包时,总报错:E:could not get lock /var/lib/dpkg/lock -open等 出现这个问题的原因可能是有另外一个程序 ...
- 【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 ...
- apt-get报错could not get lock /var/lib/dpkg/lock -open等
用apt-get命令安装一些软件包时,总报错:E:could not get lock /var/lib/dpkg/lock -open等 出现这个问题的原因可能是有另外一个程序正在运行,导致资源被锁 ...
- 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: Reso ...
- 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 t ...
随机推荐
- com.mysql.jdbc.MysqlDataTruncation: Data truncation异常
Exception in thread "main" com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too l ...
- 微服务学习之路(三)——实现RPC远程服务调用
RPC(Remote Producedure Call)调用原理:服务消费者称为客户端,服务提供者称为服务端,处于不同网络地址,需要建立网络连接.建立连接后,双方还必须按照某种约定的协议进行网络通讯— ...
- es6 Object 数据属性和访问器属性
原文 :http://www.jb51.net/article/91698.htm 总结 ES5提供了Object.getOwnPropertyDescripter()方法来获取给定属性的描述符. p ...
- Simple Redux
This is a post that tries to explain the the basics of Redux. We’ll build a minimal working example ...
- [Algorithm] 387. First Unique Character in a String
Given a string, find the first non-repeating character in it and return it's index. If it doesn't ex ...
- Linux yum 包 下载地址
yum包网址: http://www.rpmfind.net/linux/rpm2html/search.php?query=yum
- 【LG2154】[SDOI2009]虔诚的墓主人
[LG2154][SDOI2009]虔诚的墓主人 题面 洛谷 题解 如果您没有看懂题,请反复阅读题面及样例 可以发现,对于某一个点,它的答案就是上下左右几个组合数乘起来. 这样直接做复杂度显然爆炸,考 ...
- paython基础-格式化输出
目录 %s %r %d 及其他%... formate f"{变量}" 详细查找:https://docs.python.org/3/library/string.html#for ...
- Spark 部署即提交模式意义解析
Spark 的官方从 Cluster Mode Overview 中,官方向我们介绍了 cluster 模式的部署方式. Spark 作为独立进程在集群上运行,他们通过 SparkContext 进行 ...
- WAMP配置允许外网访问、绑定域名
如果wamp默认端口已经被占用,需要修改,则打开apache目录下的,conf文件下的httpd.conf文件 如图,把框中的默认80端口修改为自己需要的端口,然后重启WAMP即可. 想要实现外网访问 ...