What is the step-by-step procedure to fix the "The following packages have unmet dependencies"?

I tried everything but made no progress. Can a smart soul help out?

Of course just sudo apt-get -f install does not work, same error.

$ sudo apt-get install arping [sudo] password for dloo: 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: arping : Depends: libnet1 (>= 1.1.2.1) but it is not going to be installed Depends: libpcap0.8 (>= 0.9.8) but it is not going to be installed libc-dev-bin : Depends: libc6 (< 2.16) but 2.17-0ubuntu4 is to be installed libc6-dev : Depends: libc6 (= 2.15-0ubuntu10.5) but 2.17-0ubuntu4 is to be installed libnih1 : PreDepends: libc6 (< 2.16) but 2.17-0ubuntu4 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

$ uname -a Linux li366-234 2.6.39.1-x86_64-linode19 #1 SMP Tue Jun 21 10:04:20 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux $ cat /etc/issue Ubuntu 11.04 \n \l 
4

4 Answers

I have no idea if it is still relevant for you to get help on this, but here is a summary of the things one could do to help in such situation (from here at Appuals (appuals.com)) :

Method 1: Use the -f parameter (I know you already did that, but I gather everything here altogether)

sudo apt-get install -f sudo dpkg --configure -a sudo apt-get install -f 

Method 2: Use Aptitude

sudo aptitude install PACKAGENAME

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

Method 3: Make sure that the restricted and universe repositories are enabled and try a better server

software-properties-gtk 
  • In the Ubuntu Software tab, make sure that all the repositories (main, universe, restricted, multiverse) are enabled.
  • Click the list of servers where it says “Download from”, and choose
  • Click “Select Best Server”.
  • Press Alt, Ctrl and T simultaneously to open a Terminal, and type in

    sudo apt-get update 

    then press Once it’s done running, try installing the software again.

Method 4: Clean the package database

sudo apt-get clean sudo apt-get autoclean 

Method 5: Eliminate any held packages

sudo apt-get -u dist-upgrade 

then (if pb):

sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade 

and see if it fixes the issue. If it exits with X not upgraded at the end, where X is the number of held packages, you will need to delete them one by one.

To remove a held package,

sudo apt-get remove --dry-run PACKAGENAME

(PACKAGENAME is the package you’re trying to remove). The --dry-run parameter makes sure you are informed of whatever happens next. When you’ve removed all packages, try installing the one that caused the problem in the first place, and see what happens.

Method 6: Purge/Remove/Disable PPAs

Personal Package Archives are repositories that are hosted on the Launchpad, and are used to upgrade or install packages that aren’t usually available in the official repositories of Ubuntu. They’re most commonly a cause of unmet dependencies, especially when they’re used to upgrade an existing package from the Ubuntu repository. You can either disable, remove or purge them.

Then if they still show some dependency issues, let's purge them:

apt purge packageXX packageYY packageZZ

etc. until everything is clean

Some say also to edit /var/lib/dpkg/status and remove blocs which have not complete installation but I doubt this really solves problems, it is just hiding it under the carpet.

  1. Did you try the following?

    apt-get check 
  2. Try first:

    sudo dpkg --configure -a 

Followed by:

sudo apt-get -f install 
1

According to the information on Ubuntu's wiki (), Ubuntu 11.04 (Natty Narwhal) reached end-of-life on October 28, 2012. Your specific error implies that the available version of arping depends on more updated versions of libraries that probably just aren't available in Natty Narwhal, or Natty Narwhal may simply refuse to build those libraries because they will introduce incompatibilities with the rest of your unsupported platform.

Your two options are to see if you can find the sources for the libraries that arping needs (keeping in mind to satisfy arping's version requirements), and see if you can have any success building them manually (e.g. the whole ./configure && make && sudo make install routine). But I can't guarantee that that will work, and again, your OS is unsupported. Alternatively, backup all your desired data, download a copy of Ubuntu 17.10.1 (or 16.04.3 if you prefer to stick with LTS) and make a bootable USB and install an updated, currently supported version of Ubuntu.

The solution is simple if you read the error.

Suppose the package you're trying to install is packageA.

Trying to install packageA will lead you to something like this:

packageA: Depends: packageX (>= a.b) but it is not going to be installed 

You need to run sudo apt-get install packageX.

Likely you will have another error which says:

packageX: Depends: packageY (>= a.b) but it is not going to be installed 

Run sudo apt-get install packageY to install it.

Keep going like this (IMO most packages have a tree 3-4 nodes deep), until you install the last dependency in the series.

After that, your first command to install packageA will run successfully.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like