6

I recently switched to Ubuntu 15.10.

I need to use a proxy to connect to external internet.And on my local internet there's a repo that doesn't require proxy to connect.

So I wrote something like this in /etc/apt/apt.conf.d/proxy

Acquire::http::Proxy::google.com "http://XXX:8087";
Acquire::http::Proxy::spotify.com "http://XXX:8087";

Unfortunately,this doesn't work, apt-get update says failed to connect google spotify. I also tried change it to this.

Acquire::http::Proxy "http://XXX:8087";

I can connect to google and spotify now, but I can't connect to my local repo. Isn't there a better workaround?

2
  • 1
    Are you connecting to google.com or dl.google.com or www.google.com, or some other subdomain of google.com altogether?
    – muru
    Commented Jan 1, 2016 at 18:31
  • yes, it's dl.google.com
    – arslan2012
    Commented Jan 2, 2016 at 2:55

1 Answer 1

7

Create a file: /etc/apt/apt.conf.d/99proxy and in this file insert the following:

Acquire::http::Proxy {
    your.local.repository DIRECT;
};

This tells apt to use a direct connection (so not via proxy) to access your local repository.

Change your.local.repository to the correct location of your local repository.

1
  • 2
    Thanks for your reply, it's my fault all alone,changing 'Acquire::http::Proxy::google.com "XXX:8087";' to'Acquire::http::Proxy::dl.google.com "XXX:8087";' worked
    – arslan2012
    Commented Jan 2, 2016 at 3:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .