I would like to disable automatically installing packages from this particular source:
$ cat /etc/apt/sources.list.d/unstable.list
deb unstable main contrib non-free non-free-firmware
Of course the easiest way would be the removal of the file above file from "/etc/apt/sources.list.d
".
But I want it to be there, because apt-cache search
shall be able to find entries from that archive, even though it shall never be used to install packages from there automatically.
If I really want to install a package found there, I will override the pin priority manually for that particular package.
I know that this would probably work:
$ cat /etc/apt/preferences.d/debian
Package: *
Pin: release a=unstable
Pin-Priority: -1
Except that this would be too general: I only want to ignore the "unstable" release of the "deb.debian" repository, but not also all releases of the same name in other repositories.
I therefore would also want to specify the origin of the repository, as in
$ cat /etc/apt/preferences.d/debian
Package: *
Pin: origin "deb.debian"
Pin-Priority: -1
But this is also too general and would pin more packages than I want.
Therefore, what I really need is a combination of both variants, like in
$ cat /etc/apt/preferences.d/debian
Package: *
Pin: origin "deb.debian", release a=bookworm-backports
Pin-Priority: -1
But unfortunately, that does not seem to work.
While apt-cache policy
does not give any complaints about the syntax used in the last variant, its output does not show any effect of the file contents either.
I have found many examples how to pin either based on repository location or on release a=
, but no example showed me how to combine both cases.
Does someone know how to combine the "origin
" and "release a=
" syntaxes into a single "Pin:" line expression?