由于依赖性,无法安装软件包

当我尝试安装包时 –

sudo apt-get -f install golang-go Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: chromium-browser : Depends: libnspr4 (>= 2:4.9-2~) but it is not going to be installed or libnspr4-0d (>= 1.8.0.10) but it is not going to be installed evolution-data-server : Depends: libnspr4 (>= 2:4.9-2~) but it is not going to be installed or libnspr4-0d (>= 1.8.0.10) but it is not going to be installed golang-go : Depends: golang-src (>= 2:1.2.1-2ubuntu1) but it is not going to be installed Depends: golang-go-linux-amd64 (= 2:1.2.1-2ubuntu1) but it is not going to be installed google-chrome-stable : Depends: libnspr4 (>= 2:4.9-2~) but it is not going to be installed libcamel-1.2-45 : Depends: libnspr4 (>= 2:4.9-2~) but it is not going to be installed or libnspr4-0d (>= 1.8.0.10) but it is not going to be installed libnm-util2 : Depends: libnspr4 (>= 2:4.9-2~) but it is not going to be installed or libnspr4-0d (>= 1.8.0.10) but it is not going to be installed libnss3 : Depends: libnspr4 (>= 2:4.12) but it is not going to be installed libnss3-nssdb : Depends: libnss3 (= 2:3.23-0ubuntu0.14.04.1) but 2:3.28.4-0ubuntu0.14.04.3 is to be installed liboxideqtcore0 : Depends: libnspr4 (>= 2:4.9-2~) but it is not going to be installed or libnspr4-0d (>= 1.8.0.10) but it is not going to be installed libpurple0 : Depends: libnspr4 (>= 2:4.9-2~) but it is not going to be installed or libnspr4-0d (>= 1.8.0.10) but it is not going to be installed libreoffice-core : Depends: libnspr4 (>= 2:4.9-2~) but it is not going to be installed or libnspr4-0d (>= 1.8.0.10) but it is not going to be installed skypeforlinux : Depends: libnspr4 (>= 2:4.9-2~) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

当我尝试 –

 sudo apt-get install libnspr4 Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: libnss3 : Depends: libnspr4 (>= 2:4.12) but 2:4.10.2-1ubuntu1 is to be installed libnss3-nssdb : Depends: libnss3 (= 2:3.23-0ubuntu0.14.04.1) but 2:3.28.4-0ubuntu0.14.04.3 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

任何人都可以帮我解决这个问题吗? 我在Ubuntu 14.04上

这里有几件事要尝试。

方法一:

这是最容易尝试的。 而不是使用sudo apt-get install PACKAGENAME,其中PACKAGENAME是您尝试使用apt系统安装的软件包,请使用sudo apt-get install -f。 -f参数将尝试更正已断开依赖关系的系统,之后您将能够安装有问题的程序包。

打开终端并输入:

 sudo apt-get install -f 

然后按ENTER键。

现在输入:

 sudo dpkg --configure -a 

然后按ENTER键。

现在又一次:

 sudo apt-get install -f 

方法二:

Aptitude是apt-get的替代品,您可以将其用作更高级别的包管理器。 您可以使用它来尝试使用它来安装包,而不是apt-get,但首先需要安装aptitude。

打开终端并输入:

 sudo apt-get install aptitude 

然后按ENTER键。

现在输入:

 sudo aptitude install PACKAGENAME 

然后按ENTER键。

PACKAGENAME是您正在安装的软件包。 这将尝试通过aptitude而不是apt-get来安装软件包,这应该可能修复未满足的依赖项问题。

如果这些不起作用

破损的包裹很可能被锁定,需要删除。 要删除锁定的文件,请打开终端并输入:

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

然后按ENTER键。

锁定的文件也可能需要在缓存目录中删除。 为此,请打开终端并输入:

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

希望这可以帮助,