I'm running the latest version of Ubuntu 09.10 (syphyllitic sphinx or whatever the heck the codename is) and I'm trying to figure out how to block a package from installing as the result of a dependency. For this example, let's say that I would like to make it so bc is never installed, even though ubuntu-desktop claims to require it. Is there an easy way to make it so when I do an update and there is a new version of ubuntu-desktop it will never again try to install bc?

I think that this make be possible using some custom dummy packages and dpkg-divert or some such magic, but I just can't find some good docs on how to do it.

I'm also aware that doing something like this could cause a tear in the fabric of spacetime, but I'm willing to deal with that.

  • 3
    I'd like to answer but I simply can NOT be responsible for spacetime fabric tears. I'm so sorry, but I must think of the children. – Chris_K Jan 5 '10 at 2:18

Check out the "equivs" package. You can fake up a package that pretends to offer whatever the real package you're installing needs.


This page from the Ubuntu wiki should fix your problem. It explains how to create a new metapackage without the uninstalled application.

Having said that, I just lived without the ubuntu-desktop metapackage.


i don’t know if it works for mandatory requirements, but it did a good job for me blocking the recommended package ttf-mscorefonts-installer when installing/upgrading wine.

i figured this package just exists to make the internet look crappy in order to keep young linux hackers from posing a threat to MS there.

put the following into your /etc/apt/preferences:

Package: i-am-a-package-containing-junk
Pin: version *
Pin-Priority: -1

the Pin-Priority: -1 says that the matched versions of the matched packages should never be installed, while the rest matches every version of the package i-am-a-package-containing-junk, effectively preventing its installation.


I'm not aware of any simple way of doing this, and I doubt there is one. Dependencies are there for a reason after all, and the tools offer very little support for ignoring them.

As a matter of fact, even forcibly uninstalling a dependency (dpkg -r --force-depends <package>) will cause aptitude & friends to stop working until you fix the damage. So I'm afraid what you're asking is not possible, at least not with a simple command.

The simplest way to accomplish this is probably to create an empty package with a high version number, but even that might break when package dependencies change.

Could you explain what you're trying to do? Then maybe we can help.


in this specific case... don't use the metapackage- there's probably a 'core' package, and you can install what you need atop that- i had the same issue with xorg since i don't see the point of installing a nvidia drivers on an intel graphics based laptop- so i installed xorg-intel, rather than xorg-core.

  • Unfortunately, it's for a suite of software for work that checks to ensure the meta-package is installed. If the meta-package isn't installed, bad things happen and it phones home, etc. – Pridkett Jan 5 '10 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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