错误1
通过终端安装程序sudo apt-get install xxx时出错:
1 | E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) |
出现这个问题可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因可能是上次运行安装或更新时没有正常完成,进而出现此状况,解决的办法其实很简单:
在终端中敲入以下两句
1 | sudo rm /var/cache/apt/archives/lock |
错误2
出现错误:
1 | The following packages have unmet dependencies: |
解决方法:
1 | sudo apt-get install -f |
错误3
出现错误:
1 | debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable |
解决方法:
1 | sudo lsof /var/cache/debconf/config.dat |
错误4
出现错误
1 | Reading package lists... Done |
解决方法
1 | sudo rm /var/lib/apt/lists/lock |
错误5
出现错误The list of sources could not be read.
例如下面:
1 | ubuntu@ubuntu-ubuntu:~$ sudo apt-get update |
则打开终端输入:
1 | sudo gedit /etc/apt/sources.list |
将有问题的源删去即可
错误5
出现错误:
1 | error: parsing file '/var/lib/dpkg/updates/0002' near line 0:newline in field name `#padding': |
解决方法:
1 | sudo rm /var/lib/dpkg/updates/* |
错误6
ubuntu安装软件has install-snap change in progress
错误:
今天在ubuntu软件商店安装idea报错:
1 | cannot install "intellij-idea-community": snap "intellij-idea-community" has "install-snap" change in progress |
其实就是软件之前安装了一次,只是没安装完。解决方案
1 | snap changes |
可以看到ID=5
是我之前安装失败的。
现在我们终止它
1 | sudo snap abort 5 |
好了,可以重新安装了