How to tell apt that dependencies are resolved manually?

All we need is an easy explanation of the problem, so here it is.

Let’s say there is a software I don’t want to install through apt, but manually. (TeXLive, because I want to use the 2011 release and apt only has the 2009 version.)

Let’s say there is another software I’d like to install through apt, which however depends on the first software. (Vim LaTeXSuite, as it’s a pain to install manually for system-wide use.)

Per default, apt doesn’t “see” the first software, and proceeds to install lots of unneeded and unwelcome cruft (i.e. TeXLive 2009) just to satisfy the dependency metadata.

How can I either:

  • Tell apt that a given package (e.g. texlive) is installed for all practical purposes, and that it shouldn’t be installed as dependency of some other package?

  • Tell apt to install a given package (e.g. vim-latexsuite) without bothering about its dependencies?

I’ve sifted through various apt-related manpages and came up empty, and also found this question on this site but feel that there has to be a less hackish way to do this, no?

(From my Gentoo times, I remember emerge --inject and /etc/portage/package.provides, and am basically looking for the apt equivalents.)

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

You should use the equivs package to generate meta-packages that provide these dependencies, and then use dpkg to install these packages.

Installing equivs and reading its documentation should be enough, but this guide for Ubuntu is quite extensive and should apply to other APT systems as well.


Also, if you feel that a package should be able to be installed without the specified dependency, you should file a bug against the package, explaining the case where the dependency is not needed.

In this case, texlive-base-bin seems to only be “Recommended” and not a “Dependency” in the base Debian distribution at least (probably in part since texlive is such an enormous package), but because it is common to install upstream TeX Live on Debian since the distribution version often lags behind greatly (for the reason that the package is such a beast that it often can’t be packaged without substantial work, which is mostly done by one or a few persons, who claim they have lives beside Debian), the equivs trick is often used with TeX Live (wow, that sentence got out of hand 🙂 ).


Addition: For more detailed instructions for those looking to install TeXLive outside of the package system, these instructions on TeX.SX are more extensive and will most likely continue to be kept updated. They also include more explicit instructions regarding the equivs step.

Method 2

You can use the --nodeps flag on dpkg , which should install the package with no dependancies at all.

   --ignore-depends=package,...
          Ignore  dependency-checking for specified packages (actu-
          ally, checking is performed, but only warnings about con-
          flicts are given, nothing else)

There’s a very similar question on Serverfault which is worth looking at as well

Method 3

The following will remove the dependancy from a .deb file, in this case removing libperl5.20 dependancy from freeradius:

dpkg-deb -x freeradius_2.2.5+dfsg-0.2+deb8u1_amd64.deb freeradius
dpkg-deb -e freeradius_2.2.5+dfsg-0.2+deb8u1_amd64.deb freeradius/DEBIAN
sed -i  -e 's/, libperl5.20 (>= 5.20.2)//g' freeradius/DEBIAN/control
dpkg-deb -b freeradius freeradius_2.2.5+dfsg-0.2+deb8u1_amd64.deb

This allows you to install the package without apt knowing the dependency exists.

If you are manually installing specific versions of packages then you might also want to stop apt-get upgrade from upgrading the package in the future:

apt-mark hold freeradius

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply