1

When I try to install a package -

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).

When I try -

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).

Can anyone help me solve this problem? I am on Ubuntu 14.04

siddharth185
  • 141
  • 4

1 Answers1

0

Here are a couple of things to try.

Method One:

This is the easiest one to try. Instead of using sudo apt-get install PACKAGENAME, where PACKAGENAME is the package you’re trying to install with the apt system, use sudo apt-get install -f. The -f parameter will attempt to correct a system which has broken dependencies, after which you’ll be able to install the package in question.

Open a Terminal and type in:

sudo apt-get install -f

and press ENTER.

Now type in:

sudo dpkg --configure -a

and press ENTER.

Now one more time:

sudo apt-get install -f

Method Two:

Aptitude is an alternative of apt-get which you can use as a higher-level package manager. You can use it to try and install your package with it, instead of apt-get, but first you need to install aptitude.

Open a Terminal and type in:

sudo apt-get install aptitude

and press ENTER.

Now type in:

sudo aptitude install PACKAGENAME

and press ENTER.

PACKAGENAME is the package you’re installing. This will try to install the package via aptitude instead of apt-get, which should potentially fix the unmet dependencies issue.

IF THOSE DO NOT WORK

The broken package is mot likely locked and needs to be deleted. To delete the locked file, open a Terminal and type in:

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

and press ENTER.

The locked file may also need to be deleted in the cache directory. To do that, open a Terminal and type in:

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

Hope this helps,

Dave
  • 1,454
  • Hi. I tried doing that. Here is the output - https://pastebin.com/ZC5NjzzR Its asking to remove a lot of packages which is weird. A lot of them are essential ones. – siddharth185 Mar 28 '18 at 16:11
  • Wow, you're right, I get the packages no longer required, but not the others. Okay, try this; install Muon Package Manager from the Software Center. I use this when most things seem to fail. Once installed, type libnspr4 in the search. When that comes up, click on it under Package. Now mark it for installation; the lower right of the window. It should bring up the additional packages to be installed (a lot of which should be the dependencies). Click ok and then click "Apply Changes". This should do the trick. – Dave Mar 29 '18 at 01:52
  • Except I can't install anything due to this issue :( – siddharth185 Mar 30 '18 at 15:51
  • Have you tried: $ sudo apt-get update –fix-missing? Also, check my edited answer. Look at "IF THOSE DO NOT WORK". The lock file is what is keeping you from being able to install anything. – Dave Mar 30 '18 at 22:28