Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Apt pinning wildcards

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
rpglover64
Posts: 5
Joined: 2009-10-23 17:59

Apt pinning wildcards

#1 Post by rpglover64 »

Is it possible to do something like this:

Package: ghc6*
Pin: release a=unstable
Pin-Priority: 701

Package: libghc6*
Pin: release a=unstable
Pin-Priority: 701

and have it actually do what I want?

i.e. can you pin on a regex or a glob that matches a name?

User avatar
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: Apt pinning wildcards

#2 Post by bugsbunny »

No you can't. If you could I wouldn't need this:
Package: clamav clamav-base clamav-daemon clamav-docs clamav-freshclam libclamav6
Pin: release a=unstable,o=Debian
Pin-Priority: 900

rpglover64
Posts: 5
Joined: 2009-10-23 17:59

Re: Apt pinning wildcards

#3 Post by rpglover64 »

:(

Feature request?

User avatar
craigevil
Posts: 5391
Joined: 2006-09-17 03:17
Location: heaven
Has thanked: 28 times
Been thanked: 39 times

Re: Apt pinning wildcards

#4 Post by craigevil »

You can't use wildcards for a package, but if you are running testing and just want to hold all packages from unstable you can something like:

Package: *
Pin: release a=experimental
Pin-Priority: 101

I do that when I have packages from exp installed and it works just fine.
Raspberry PI 400 Distro: Raspberry Pi OS Base: Debian Sid Kernel: 5.15.69-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"
My Giant Sources.list

rpglover64
Posts: 5
Joined: 2009-10-23 17:59

Re: Apt pinning wildcards

#5 Post by rpglover64 »

So I have both unstable and stable pinned lower than testing. however, when it comes to haskell, I would like to have unstable packages to be the default.

User avatar
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: Apt pinning wildcards

#6 Post by bugsbunny »

rpglover64 wrote:So I have both unstable and stable pinned lower than testing. however, when it comes to haskell, I would like to have unstable packages to be the default.
A minor pain to setup, since there's a fair number of packages involved. But it's only a one time setup, with possibly some maintenance down the road if some packages change names.

User avatar
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: Apt pinning wildcards

#7 Post by bugsbunny »

This might help you a bit :)

Code: Select all

aptitude search ~n"haskell~|ghc6" -F"%p"|sed 's?\([^ ]*\)?Package: \1\nPin: release a=unstable\nPin-Priority: 701\n?'
You may want to think about making the output a separate file and dropping it into /etc/apt/preferences.d/.
The result will require a bit more editing. For one the "blank lines" may actually contain spaces, which will make apt-cache (at least) unhappy. You'll also get some not found packages if they don't exist in unstable. How to correct those problems I'll leave as an exercise for you to figure out (it's not difficult to solve either of those).

rpglover64
Posts: 5
Joined: 2009-10-23 17:59

Re: Apt pinning wildcards

#8 Post by rpglover64 »

Thank you.

Post Reply