up vote 0 down vote favorite
share [g+] share [fb]

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 or another?

Can I overcome the fact that it is a dependency and still be able to upgrade my system?

I am thinking about the messaging applet thing 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).

link|improve this question

Is it available by apt-get command? – Vidyadhar Jan 27 at 19:16
Yes, I am talking about apt as tagged on the question. – Bruno Pereira Jan 27 at 19:19
feedback

1 Answer

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:

  1. download the required packages:

    sudo apt-get --download-only install pkg-name
    
  2. remove unwanted packages

    sudo rm /var/cache/apt/archive/bad-pkg_*.deb
    
  3. install all other packages

    sudo apt-get --no-download --ignore-missing install pkg-name
    

On the other side, to install a package without recommends:

sudo apt-get --no-install-recommends install pkg-name
link|improve this answer
@BrunoPereira: see updated answer. – enzotib Jan 27 at 20:59
@BrunoPereira: I would like to have some feedback from you. – enzotib Jan 28 at 17:48
When you lock a package version does also lock a non installed package? I think (I'm sure) your solution would work but would really not rather use since in a update example it would still install the package, no? – Bruno Pereira Jan 28 at 17:56
Yes, in a next install apt would try to resore what it think is missing. – enzotib Jan 28 at 18:10
feedback

Your Answer

 
or
required, but never shown

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