Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 stable/main amd64 Packages
     release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main
 500 stable/main amd64 Packages
     release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main
$ grep Origin /var/lib/apt/lists/*_Release
/var/lib/apt/lists/ Google, Inc.
/var/lib/apt/lists/ Google, Inc.
share|improve this question
Have you tried o="Google, Inc.", or o='Google, Inc.'? – enzotib Sep 2 '11 at 16:51
Do you still experience the same issue? – Braiam Oct 30 '13 at 0:59

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

Pin: origin

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

share|improve this answer

If you escape the comma, the space should also be escaped, like in:

o=Google\,\ Inc.
share|improve this answer
Have you tested this? It doesn't appear to work for me. – ændrük Sep 8 '11 at 16:25
I couldn't, my policies do not contain o= with whitespace, just a guess. – aquaherd Sep 8 '11 at 17:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.