Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
3  
+1 - for the codename! –  William Hilsum Jan 5 '10 at 2:11
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

5 Answers 5

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

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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