apt pinning to blacklist a package

View: New views
7 Messages — Rating Filter:   Alert me  

apt pinning to blacklist a package

by Rob Owens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I can't figure out what I'm doing wrong...

I want to prevent a particular package from ever being installed.  In /etc/apt/preferences I have:

Package: somepackage
Pin: version *
Pin-Priority: -1

But the package can still be installed by either command:

apt-get install somepackage
apt-get install otherpackage (where 'otherpackage' depends on
'somepackage')

I thought maybe the 'version *' was throwing it off, so I replaced '*' with
the actual version number and the package still gets installed.

Any ideas how to achieve my goal of blacklisting this particular package?

-Rob


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: apt pinning to blacklist a package

by Rob Owens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jul 07, 2009 at 09:12:39PM -0400, Rob Owens wrote:

> I can't figure out what I'm doing wrong...
>
> I want to prevent a particular package from ever being installed.  In /etc/apt/preferences I have:
>
> Package: somepackage
> Pin: version *
> Pin-Priority: -1
>
> But the package can still be installed by either command:
>
> apt-get install somepackage
> apt-get install otherpackage (where 'otherpackage' depends on
> 'somepackage')
>
> I thought maybe the 'version *' was throwing it off, so I replaced '*' with
> the actual version number and the package still gets installed.
>
> Any ideas how to achieve my goal of blacklisting this particular package?
>
> -Rob
>
Argh, moments after posting I came across a solution (I swear I've been googling for days).  It works like this:

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

Since "fakerepo" is not a valid release, "somepackage" is never
installable.  I'm still not sure why my original scheme didn't work.

I got the solution from here:  http://discuss.itwire.com/viewtopic.php?f=29&t=13787&p=49182

-Rob


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: apt pinning to blacklist a package

by Andrei Popescu-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue,07.Jul.09, 21:38:57, Rob Owens wrote:
>
> Since "fakerepo" is not a valid release, "somepackage" is never
> installable.  I'm still not sure why my original scheme didn't work.

Sounds kind of hackish. When you have troubles with pinning the output
of 'apt-cache policy <package>' helps a lot.

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)


signature.asc (500 bytes) Download Attachment

Parent Message unknown Re: apt pinning to blacklist a package

by Andrei Popescu-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

[You wrote to me directly instead of the list. I'm putting it back,
untrimmed, because others could help]

On Wed,08.Jul.09, 20:20:14, Rob Owens wrote:

> On Wed, Jul 08, 2009 at 01:24:35PM +0300, Andrei Popescu wrote:
> > On Tue,07.Jul.09, 21:38:57, Rob Owens wrote:
> > >
> > > Since "fakerepo" is not a valid release, "somepackage" is never
> > > installable.  I'm still not sure why my original scheme didn't work.
> >
> > Sounds kind of hackish. When you have troubles with pinning the output
> > of 'apt-cache policy <package>' helps a lot.
> >
> I agree, it does seem kind of hackish.
>
>
> /etc/apt/preferences:
>
> Package: libmono0
> Pin: version *
> Pin-Priority: -1
>
>
> apt-cache policy libmono0
>
> libmono0:
>   Installed: (none)
>   Candidate: 1.9.1+dfsg-6
>   Package pin: 2.0.1-6
>   Version table:
>      2.0.1-6 -1
>         500 http://ftp.us.debian.org squeeze/main Packages
>      1.9.1+dfsg-6 -1
>         990 http://ftp.us.debian.org lenny/main Packages
>
 
As you can see here, your pin doesn't work...

> apt-get install -s libmono0
>
> Reading package lists... Done
> Building dependency tree      
> Reading state information... Done
> The following NEW packages will be installed:
>   libmono0
> 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
> Inst libmono0 (1.9.1+dfsg-6 Debian:5.0.2/stable)
> Conf libmono0 (1.9.1+dfsg-6 Debian:5.0.2/stable)
>
> (and the same thing happens if I "apt-get install -s f-spot", only a lot
> more packages get installed -- including libmono0)
>
> -Rob
... and apt-get confirms it. Looking through 'man apt_preferences' it
seems to me it's the 'Pin: Version *' entry. Try something like this:

Package: libmono0
Pin: origin ""
Pin-Priority: -1

Regards,
Andrei
--
Dacă aveți probleme cu afișarea diacriticelor trebuie să vă actualizați
fonturile. Vedeți http://wiki.debian.org/L10N/Romanian/Lenny/Notes pentru
mai multe detalii.


signature.asc (500 bytes) Download Attachment

Re: apt pinning to blacklist a package

by Rob Owens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 09, 2009 at 09:51:54AM +0300, Andrei Popescu wrote:
> [You wrote to me directly instead of the list. I'm putting it back,
> untrimmed, because others could help]
>
That was unintentional.  Thanks for forwarding it to the list.

> On Wed,08.Jul.09, 20:20:14, Rob Owens wrote:
> > On Wed, Jul 08, 2009 at 01:24:35PM +0300, Andrei Popescu wrote:
> > > On Tue,07.Jul.09, 21:38:57, Rob Owens wrote:
> > > >
> > > > Since "fakerepo" is not a valid release, "somepackage" is never
> > > > installable.  I'm still not sure why my original scheme didn't work.
> > >
> > > Sounds kind of hackish. When you have troubles with pinning the output
> > > of 'apt-cache policy <package>' helps a lot.
> > >
> > I agree, it does seem kind of hackish.
> >
> >
> > /etc/apt/preferences:
> >
> > Package: libmono0
> > Pin: version *
> > Pin-Priority: -1
> >
> >
> > apt-cache policy libmono0
> >
> > libmono0:
> >   Installed: (none)
> >   Candidate: 1.9.1+dfsg-6
> >   Package pin: 2.0.1-6
> >   Version table:
> >      2.0.1-6 -1
> >         500 http://ftp.us.debian.org squeeze/main Packages
> >      1.9.1+dfsg-6 -1
> >         990 http://ftp.us.debian.org lenny/main Packages
> >
>  
> As you can see here, your pin doesn't work...
>
> > apt-get install -s libmono0
> >
> > Reading package lists... Done
> > Building dependency tree      
> > Reading state information... Done
> > The following NEW packages will be installed:
> >   libmono0
> > 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
> > Inst libmono0 (1.9.1+dfsg-6 Debian:5.0.2/stable)
> > Conf libmono0 (1.9.1+dfsg-6 Debian:5.0.2/stable)
> >
> > (and the same thing happens if I "apt-get install -s f-spot", only a lot
> > more packages get installed -- including libmono0)
> >
> > -Rob
>
> ... and apt-get confirms it. Looking through 'man apt_preferences' it
> seems to me it's the 'Pin: Version *' entry. Try something like this:
>
> Package: libmono0
> Pin: origin ""
> Pin-Priority: -1
>
That doesn't work either.  libmono0 is still installable.

apt-cache policy libmono0

libmono0:
  Installed: (none)
  Candidate: 1.9.1+dfsg-6
  Package pin: (not found)
  Version table:
     2.0.1-6 -1
        500 http://ftp.us.debian.org squeeze/main Packages
     1.9.1+dfsg-6 -1
        990 http://ftp.us.debian.org lenny/main Packages

-Rob


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: apt pinning to blacklist a package

by Andrei Popescu-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu,09.Jul.09, 21:50:43, Rob Owens wrote:

> >
> That doesn't work either.  libmono0 is still installable.
>
> apt-cache policy libmono0
>
> libmono0:
>   Installed: (none)
>   Candidate: 1.9.1+dfsg-6
>   Package pin: (not found)
>   Version table:
>      2.0.1-6 -1
>         500 http://ftp.us.debian.org squeeze/main Packages
>      1.9.1+dfsg-6 -1
>         990 http://ftp.us.debian.org lenny/main Packages
 
Sorry, should have tested before suggesting it. Unfortunately I have no
solution for your problem, see #317186 for more info.

Maybe you should stick to your hack, unless somebody else has a better
idea...

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)


signature.asc (500 bytes) Download Attachment

Re: apt pinning to blacklist a package

by Rob Owens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jul 10, 2009 at 09:58:23AM +0300, Andrei Popescu wrote:

> On Thu,09.Jul.09, 21:50:43, Rob Owens wrote:
> > >
> > That doesn't work either.  libmono0 is still installable.
> >
> > apt-cache policy libmono0
> >
> > libmono0:
> >   Installed: (none)
> >   Candidate: 1.9.1+dfsg-6
> >   Package pin: (not found)
> >   Version table:
> >      2.0.1-6 -1
> >         500 http://ftp.us.debian.org squeeze/main Packages
> >      1.9.1+dfsg-6 -1
> >         990 http://ftp.us.debian.org lenny/main Packages
>  
> Sorry, should have tested before suggesting it. Unfortunately I have no
> solution for your problem, see #317186 for more info.
>
> Maybe you should stick to your hack, unless somebody else has a better
> idea...
>
Thanks for the help. Whew, that's a long bug.  I'll give it a good read and
report back if I find any fixes.

-Rob


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...