出现了E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)和unable to locate package net-tools 怎么办?

这个属于我install网络包时出现的问题之一:

问题如图:

出现了E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)和unable to locate package net-tools 怎么办?

我的解决方案是:

删除锁定文件

sudo rm /var/lib/dpkg/lock-frontend       
sudo rm /var/lib/dpkg/lock

 

执行如图: 

出现了E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)和unable to locate package net-tools 怎么办?

完蛋,又有问题了出现了unable to locate package net-tools,这可以确定自己的源sources.list有问题了。

我是18.04.5 2版本,17的应该也能用

进入源:sudo vi sources.list 我因为打开的是空,所以直接复制粘贴下面的内容,粘贴完,按esc 进入命令模式,按 :x 保存退出就可以了

deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe

重新执行

sudo apt-get update
sudo apt install net-tools

然后就有以下页面表示完成啦!

出现了E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)和unable to locate package net-tools 怎么办?

 出现了E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)和unable to locate package net-tools 怎么办?

其实本来是解决实现拼音输入的问题,又绕到了解决上网的问题,其实最简单的办法是我一个朋友给我看的一个博客上的,如下,输入下面两行命令就可以了,我的上网问题是通过下面这个解决的,但上面报错对于linux中执行ifconfig命令,命令无效,有用呀所以上面的不算废话。但如果是我这种一关机然后开机就容易没网的建议下面这种办法,记住收藏一下,很大可能经常需要

 

出现了E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)和unable to locate package net-tools 怎么办?

 

systemctl restart networking
/etc/init.d/network-manager restart

出现了E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)和unable to locate package net-tools 怎么办?

上一篇:MySQL - 为什么辅助索引的叶子节点data域存储的是主键值?


下一篇:linux安装python