0

Sample error:

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/universe/i18n/Translation-en Unable to connect to 192.168.1.70:8118:

Now this was working just fine until I changed the IP this morning. I have the server set to a static IP of 10.0.1.70 and for years it has been 192.168.1.70 - the IP apt-get is trying to use right now. I use privoxy and tor thus the 8118 port.

Like I said it all worked until I changed the static IP from 192.168.1.70 to 10.0.1.70. I was forced to do so because of router issues. (Long and involved story, I didn't really want to change the IP because I know something like this would happen.)

The setup for TOR/Privoxy requires that has you point Privoxy at TOR via 127.0.0.1:9050. Then point curl, etc to Privoxy via $HOME/.bashrc. Typically you would set the listen to IP for Privoxy to 127.0.0.1 but if you want it accessible to the rest of the LAN you set the IP to the server's LAN IP. Which I did a long time ago and was working fine until this morning. I have changed all instances of 192.168.1.70 to 10.0.1.70 in both /etc/privoxy/config and $HOME/.bashrc.

What makes this really strange for me is that curl is working fine. I curl icanhazip.com and voila I get a new IP every 10 minutes or so. I curl CNN.com and I get the short but sweet permanently moved to www.cnn.com message I expect. Firefox works fine. Ping works fine. And I've tested all of this via Remote Desktop over my LAN. So the connection appears to be fine for everything except apt. I've also rebooted hoping that would clear 192.168.1.70 from apt.

So the connection to the internet and DNS aren't an issue for these programs. And they are, as far as I can tell, using Privoxy/TOR just fine. The real irony here is that I've tried to open up Privoxy to go to Ubuntu's servers directly without going through TOR to speed up the downloads from Ubuntu (did this months ago).

So somewhere that I have not been able to find, apt has stored the IP 192.168.1.70. And 192.168.1.70 is no longer valid.

Thanks for the help

  • Braiam is on the right track, but you may need to look in other files in /etc/apt to see where you set the proxy. I suggest `grep 8118 -r /etc/apt` as a wider search. – Daniel Lawson Nov 03 '13 at 01:32

1 Answers1

1

The problem is that you haven't changed the proxy values in the client. You should look into /etc/apt/apt.conf.d/ for the proxy and change it to 10.0.1.70:8118.

grep -i proxy /etc/apt/apt.conf.d/* /etc/apt.conf

This will give you an idea of where is the proxy ip set. Then open the file and modify the settings.

I believe that your environment variables are OK, since you can user CURL just fine.

Braiam
  • 622
  • 4
  • 23
  • The grep command you suggest comes back empty. – Gabe Spradlin Nov 02 '13 at 23:07
  • Where did you run it? In the same machine that is throwing you the error? Also, what's the output of `grep 8118 /etc/apt/sources.list /etc/apt/sources.list.d/*` – Braiam Nov 02 '13 at 23:39
  • That option might be set in /etc/apt/apt.conf directly (eg, the file, not the include directory). I'd try 'grep 8118 -r /etc/apt/' as a wider search – Daniel Lawson Nov 03 '13 at 01:20
  • That did it. The grep 8118 -r /etc/apt and it returned /etc/apt/apt.conf. There was a proxy value set for http and https. That said I don't believe I set this manually. Certainly not with nano or gedit. Anyways, changing 192.168.1.70 to 10.0.1.70 in that file fixed it. I'm using apt-get upgrade as I write this. Thanks – Gabe Spradlin Nov 03 '13 at 05:46