Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know there is Depends, Pre-Depends, Build-Depends, etc. Is there something like Install-Depends in Debian packaging? For example, my package package-a needs Perl to install, after package-a is installed, perl is no more required so it should be removed if isn't not previously installed.

share|improve this question
up vote 1 down vote accepted

There's no such feature, and I think the reason is that it would be very rarely useful.

If your package only needs this dependency for its preinst script, then Install-Depends would allow users to remove the dependency after installing your package. This would only save disk space, which is not likely to be an issue (Debian packaging rules are devised for desktop/server-type machines, not appliances with a few megabytes of flash). It would also have the surprising consequence that a user who wanted to reinstall your package would need to install the dependency (today reinstalling a package whose dependencies are satisfied doesn't require installing dependencies).

Furthermore, most install-time dependencies tend to occur in postinst scripts, because they tend to be the most complicated. And a dependency for a postinst script is not just for install time, it's for life: the postinst script may be called to reconfigure the package (look at the Debian policy manual to see when the various package scripts are called).

share|improve this answer
Orphans are naturally detected by apt anyway, hence autoremove. If foo was installed by foobar, and foobar was removed, and nothing else requires foo, apt will figure that out. If you manually install foo, apt is smart enough to realize that you probably want it for something and won't make foo a candidate for autoremoval. – Tim Post Aug 17 '10 at 11:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .