When trying to install various application packages or modules in Ubuntu or other Linux flavor of operating system using apt-get, such as chkrootkit, mod-security, apache, mysql, rkhunter, wxpython, nfs-utils, nfs-server, portmap and etc, the error that has the similar messages as below may appear.

$ sudo apt-get install chkrootkit
Reading package lists… Done
Building dependency tree… Done
You might want to run ‘apt-get -f install’ to correct these:
The following packages have unmet dependencies.
libcurl4-gnutls-dev: Depends: libcurl3-gnutls (= 7.18.2-8) but it is not going to be installed
Depends: libgnutls-dev
Depends: zlib1g-dev but it is not going to be installed
Depends: libidn11-dev but it is not going to be installed
Depends: libkrb5-dev but it is not going to be installed or hurd but it is not installable
Depends: libldap2-dev but it is not going to be installed
E: unmet dependencies. try ‘apt-get -f install’ with no packages (or specify a solution).

The unmet dependencies error can happen randomly on many different components or modules such as libsasl2, libssl, python-wxversion, zlib, libidn, libldap, libkrb, libgssapi, libstdc++, libstdc++-devel and etc, different by each system.

Although the system suggested resolution for the error is to try to reinstall the affected dependency modules by “apt-get -f install” command to attempt to fix and correct a system with broken dependencies in place, however, many users found that the error happens again, throwing up more unmet dependencies for “first level original” unmet dependencies, causing infinite loop of the error.

The cause of the issue of unmet dependencies, despite the fact that the modules and all dependencies have been properly installed, is probably due to corrupted package database, and/or some packages weren’t installed properly. Thus, to fix and resolve the problem, try to run one of the following commands:

sudo apt-get clean


sudo apt-get autoclean

“apt-get clean” clears out the local repository of retrieved package files (i.e. the .deb files). It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. “apt-get autoclean” clears out the local repository of retrieved package files, but unlike “apt-get clean”, it only removes package files that can no longer be downloaded, and are largely useless.

After running “apt-get clean” or “apt-get autoclean”, re-run the “apt-get -f install” command in affected modules the show in the error message:

sudo apt-get -f install <module name>

Finally, try to install the package(s) again. It should be able to install properly now.

Alternative: It’s possible to delete the dependencies’ package files directly from /var/cache/apt/archives directory. Just search and locate the .deb file which has the same name with the affected module name, and delete the file away. Then, run the “apt-get -f install <module name>” to reinstall the module and fix its broken dependencies. If other packages are affected, delete their .deb files and then install the package again accordingly.