1

I need your advice as I don't know if I hit a bug, or I am misunderstanding something.

On a Debian Lenny, I am trying to prevent the installation of two particular packages, when they are requested as dependencies fromother packages. I am using the same syntax I successfully used in Squeeze, but with no success at all.

On squeeze, the following works as expected:

# cat /etc/apt/preferences.d/local-no-pike.pref
Package: pike7.6-core
Pin: version *
Pin-Priority: -1000

If I try to install pike7.6, which depends on pike7.6-core, apt and aptitude refuse to do so.

On Lenny, the only difference is that there is no support for "fragments" in /etc/apt/preferences.d, and all preferences must be in the /etc/apt/preferences file. But it's not working. E.g., if the file contains:

Package: grub-common
Pin: version *
Pin-Priority: -1000

apt doesn't stop me from installing grub, which depends on grub-common.

I used strace to see if the file is being read, and it is. I was suggested to use some Debug:: options, but they didn't help to pinpoint the problem either. I have google'd a lot with some combinations of "lenny" "prevent" "package" "installation" "pinning" and the like, but nothing nice came out. And of course I read man apt_preferences.

What am I missing here?

mmoya
  • 306
bronto
  • 121
  • 11

1 Answers1

1

as a workaround you can prevent a package upgrade by setting it to "hold" in dpkg:

echo "grub-common hold"|dpkg --set-selections

then you can revert this with

echo "grub-common install"|dpkg --set-selections

another option mentioned here: http://lists.debian.org/debian-user/2009/07/msg00477.html

Package: somepackage
Pin: release a=fakerepo
Pin-Priority: 1001

Since "fakerepo" is not a valid release, "somepackage" is never installable.

also may be helpful to check "apt-cache policy grub-common" output

Lluís
  • 435