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

61,452

Solution 1

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.

Solution 2

  1. Did you try the following?

    apt-get check
    
  2. Try first:

    sudo dpkg --configure -a
    

Followed by:

sudo apt-get -f install
Share:
61,452

Related videos on Youtube

chicago-ny
Author by

chicago-ny

Updated on September 18, 2022

Comments

  • chicago-ny
    chicago-ny over 1 year

    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
    
    • Darius
      Darius over 6 years
      What version of Ubuntu as that may give hints of why it is not working?
    • chicago-ny
      chicago-ny over 6 years
      Check my last edit
    • Darius
      Darius over 6 years
      Any chance of upgrading your Ubuntu? 11 is out of support by now I think..
    • Darius
      Darius over 6 years
      Any chance of upgrading your Ubuntu as per packages.ubuntu.com/search?keywords=arping it is not supported in that version of Ubuntu. Gluonman answer is your best bet short of upgrading.
  • chicago-ny
    chicago-ny over 6 years
    Thanks for trying to help, but both 1 and 2 gave me the same error :(