How do I include a comma in an Apt pin definition?

I'd like to create an Apt preference file with a pin definition that matches packages originating from Google, Inc..

The following definition doesn't seem to be doing anything:

Package: *
Pin: release o=Google, Inc.
Pin-priority: 900

I suspect that the comma is causing problems. How can I escape it?

None of the following have worked:

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

Curiously, the following does match Google, Inc. successfully:

  • release o=Google? Inc.

But this isn't the solution I'm looking for. I want to know how to match Google, Inc. without resorting to (precarious) wildcards.

More information:

$ 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.

Solution 1:

Not quite what you were trying to do but it may work as well for you, try:

Pin: origin dl.google.com

I settled on this after giving up trying to pin it by release and it has the same effect as long as you haven't any other repos from this host...