15

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

4

3 Answers 3

13

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.

2
  • I don't know how this came about, but Linux Mint makes texlive a "hard" dependency... will try the equivs package.
    – DevSolar
    Apr 25, 2012 at 8:41
  • equivs worked great. I created version 9999 of texlive-base-bin, overriding the original "dummy" package of the same name (provided by texlive-binaries), and installed vim-latexsuite without any troubles.
    – DevSolar
    Apr 25, 2012 at 19:33
2

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
1
  • I wish there was something more robust, but this is the only solution that worked. Life saver!
    – Rick M.
    Oct 8, 2022 at 19:11
1

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

5
  • Uh... no such thing? (At least not on the Linux Mint 12 box I have here.)
    – DevSolar
    Apr 25, 2012 at 8:34
  • 1
    hm, i seem to have made a mistake - its for dpkg, not apt-get - edited my answer to reflect this
    – Journeyman Geek
    Apr 25, 2012 at 10:02
  • That's something that confuses me to no end with the Debian derivates: The multitude of package manager interfaces. I assume that there are no tripfalls involved when mixing them? Or would I have to stick to one of them?
    – DevSolar
    Apr 25, 2012 at 10:43
  • everything is based off dpkg, essentially, apt and aptitude are front ends to that, and there's front ends for apt and aptitude. dpkg is usually used when you want to install packages off a .deb file. I tend to stick to apt-get and dpkg for most part myself. Mixing the 'default' debian flavoured package managers should usually be reasonablys safe
    – Journeyman Geek
    Apr 25, 2012 at 10:45
  • That makes your answer my preferred solution for my actual problem, since nothing depends on vim-latexsuite in turn. However, this solution doesn't mark "texlive" as being present, it merely keeps vim-latexsuite from asking for it. As such, Daniel's answer better fits the title of the question. Checkmark goes to him, kudos go to you. ;-)
    – DevSolar
    Apr 25, 2012 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.