Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm currently running 10.10 with a package removed.

I'm concerned that when it comes time to upgrade, synaptic may well install that package again. Is there way to blacklist a package that works even through distribution upgrades?

In my case, the package is mono.

share|improve this question
Couldn't you upgrade the OS and then remove mono? –  Alfredo Hernández Feb 3 '11 at 21:29
@aldomann Yes. But it's annoying. I'd rather not download mono and it's dependancies at all. –  KitsuneYMG Feb 4 '11 at 0:41

2 Answers 2

up vote 5 down vote accepted

The answer is simple:

Remove the packages you don't want using apt-get, synaptic package manager or the software center. open apt's 01autoremove file by issuing the command sudo gedit /etc/apt/apt.conf.d/01autoremove

Navigate to the bottom of the section titled Never-MarkAuto-Sections Add and entry to the section in my case to block grub I entered "grub*";. The contents of the modified file is at the bottom of this page. You will enter the package name or portion of package names, including using * as a wildcard, in my case grub* blocks all packages that start with the word grub.

It is complete, when you next open the update utility it will not show the option to upgrade or update the software that you chose to block.

My /etc/apt/apt.conf.d/01autoremove file:

 NeverAutoRemove  {
  "^linux-image.*";   "^linux-restricted-modules.*";
 {   "metapackages";

I hope you find this useful.

share|improve this answer
Did not work for me (even specifically for grub*). Details in new question: askubuntu.com/questions/196037/… –  Skaperen Oct 3 '12 at 17:39
Uh? Never-MarkAuto-Sections doesn't do this at all: it causes packages in a section not to be marked as automatically installed. You can't use package names, only section names. You can't use wildcards, only exact names. And this doesn't do anything about whether the package will be installed. –  Gilles Oct 4 '12 at 0:49

You could make your own mono package that is empty and set the version crazy high.

Sometimes this creates dep-solving issues though

share|improve this answer
the other answer is more the way you are "supposed" to do it. my answer is more hackish, but it's been used for longer i think. you should accept Ilias el Matani's answer –  hbdgaf Feb 4 '11 at 15:51

Your Answer


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.