Discussion:
Debian pin to prevent a package being installed
Jim Cheetham
2010-11-17 23:58:29 UTC
Permalink
I haven't really messed with Debian's apt pinning before (at least,
not successfully!) but today I need to set up a server to prevent a
specific package from being installed, ever.

The package is php5-xdebug, and it needs to be kept off this system
because someone is relying on the Zend Optimizer product. No comment.

In /etc/apt/preferences I thought I could give a negative priority to
a package ... but it isn't working for me ... (there is no
/etc/apt/preferences.d/ on this Debian 5 machine)

$ cat /etc/apt/preferences
Package: php5-xdebug
Pin: version *
Pin-Priority: -1

$ apt-cache policy php5-xdebug
php5-xdebug:
Installed: (none)
Candidate: 2.0.3-1
Package pin: 2.0.3-1
Version table:
2.0.3-1 -1
500 http://ftp.au.debian.org lenny/main Packages
100 /var/lib/dpkg/status

$ sudo apt-get install php5-xdebug
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
php5-xdebug
0 upgraded, 1 newly installed, 0 to remove and 41 not upgraded.
Need to get 0B/219kB of archives.
After this operation, 647kB of additional disk space will be used.
Selecting previously deselected package php5-xdebug.
(Reading database ... 20212 files and directories currently installed.)
Unpacking php5-xdebug (from .../php5-xdebug_2.0.3-1_i386.deb) ...
Setting up php5-xdebug (2.0.3-1) ...

Will someone please tell me what I am doing wrong here?

-jim

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Martin D Kealey
2010-11-18 05:15:51 UTC
Permalink
I haven't really messed with Debian's apt pinning before (at least, not
successfully!) but today I need to set up a server to prevent a specific
package from being installed, ever.
The package is php5-xdebug, and it needs to be kept off this system
I haven't tried pinning either, so my approach would be to install an empty
package along these lines:

Package: zend-optimizer-compat
Version: 1.1
Conflicts: php5-xdebug
Essential: yes
Installed-size: 0
Section: php
Priority: optional
Description: make life easy for Zend Optimizer
by keeping incompatible packages away

(The line "Essential: yes" means it can't ever be uninstalled.)

Tune the details to taste...

-Martin

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Nevyn
2010-11-18 09:28:28 UTC
Permalink
Post by Martin D Kealey
I haven't really messed with Debian's apt pinning before (at least, not
successfully!) but today I need to set up a server to prevent a specific
package from being installed, ever.
The package is php5-xdebug, and it needs to be kept off this system
I haven't tried pinning either, so my approach would be to install an empty
       Package: zend-optimizer-compat
       Version: 1.1
       Conflicts: php5-xdebug
       Essential: yes
       Installed-size: 0
       Section: php
       Priority: optional
       Description: make life easy for Zend Optimizer
        by keeping incompatible packages away
(The line "Essential: yes" means it can't ever be uninstalled.)
Tune the details to taste...
-Martin
*drool*. That's REALLY good... I'm going to have to use that.
--
Nevyn
http://nevsramblings.blogspot.com/

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Loading...