最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Debian APT: Pinning based on repository location as well as release name - Stack Overflow

programmeradmin1浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论