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

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

当我尝试安装包时-

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 上

答案1

这里有几件事可以尝试。

方法一:

这是最容易尝试的方法。不要使用 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

希望这可以帮助,

相关内容