I have a package I do not want to be installed even if another needs it.
Is there any way to "blacklist" a package from being installed even as a dependency of another?
Can I overcome the fact that it is a dependency and still be able to upgrade my system?
I am thinking in particular about the messaging indicator from Unity. If I remove it and add Unity again for some reason, I dont want the applet installed again. How can I prevent it from being installed? (or the global menu, java versions removing my custom installed one, etc... you get the idea).
To prevent
apt
from installing a packagefoo
, add a stanza for that package to the file /etc/apt/preferences which looks like the following.This will prevent apt from installing foo and will also prevent apt from installing anything that Depends on foo.
The next closest thing I can think of is to put a hold on foo at its current version which prevents foo from being upgraded (unless dpkg is given the
--force-hold
option or unless apt overrides the hold). To put a hold on package foo, do the following.You can install individual packages despite dependency violations using
dpkg --force-depends
. You won't be able to useapt
to do this unless youapt-get source
the package that Depends on foo and rebuild it without the dependency on foo.If a package needs (depends on) another package, then it should not work properly without it. If it can, it is a bug, it should be a recommend and not a depend.
To avoid to install a dependency:
download the required packages:
remove unwanted packages
install all other packages
On the other side, to install a package without recommends: