如何在 Apt 引脚定义中包含逗号?

ænd*_*rük 8 configuration special-characters pinning

我想创建一个 Apt 首选项文件,其引脚定义与源自Google, Inc..

以下定义似乎没有做任何事情:

Package: *
Pin: release o=Google, Inc.
Pin-priority: 900
Run Code Online (Sandbox Code Playgroud)

我怀疑逗号引起了问题。我怎样才能逃脱它?

以下方法均无效:

  • release o="Google, Inc."
  • release o='Google, Inc.'
  • release o=Google\, Inc.
  • release o=Google\\, Inc.

奇怪的是,以下确实匹配Google, Inc.成功:

  • release o=Google? Inc.

但这不是我正在寻找的解决方案。我想知道如何在Google, Inc.不诉诸(不稳定的)通配符的情况下进行匹配。

更多信息:

$ apt-cache policy | grep -C 1 'Google, Inc.'
 500 http://dl.google.com/linux/earth/deb/ stable/main amd64 Packages
     release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main
     origin dl.google.com
 500 http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages
     release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main
     origin dl.google.com
$ grep Origin /var/lib/apt/lists/dl.google.com_*_Release
/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_Release:Origin: Google, Inc.
/var/lib/apt/lists/dl.google.com_linux_earth_deb_dists_stable_Release:Origin: Google, Inc.
Run Code Online (Sandbox Code Playgroud)

lux*_*fer 1

不完全是你想要做的,但它可能对你有用,尝试:

Pin: origin dl.google.com

在放弃尝试通过发布来固定它之后,我决定了这一点,只要您没有来自该主机的任何其他存储库,它就会具有相同的效果......


aqu*_*erd 0

如果转义逗号,空格也应该转义,例如:

o=Google\,\ Inc.