Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.
share|improve this question
2  
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

2 Answers 2

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

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

 
discard

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.