2

I had an apt cache server installed in 192.168.40.97:3142 using apt-cacher-ng. To use it on my laptop I added a file 02proxy in /etc/apt/apt.conf.d directory which had the following content.

Acquire::http { Proxy "http://192.168.40.97:3142"; };

But then I wanted to use apt without proxy as the server had some issues. So I deleted the 02proxy file and tried apt update. But its still trying to connect to the server.

r2m@ssl-60:/etc/apt/apt.conf.d$ sudo apt update
Err:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease
  Could not connect to 192.168.40.97:3142 (192.168.40.97). - connect (111:     Connection refused)
Err:2 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease
  Unable to connect to 192.168.40.97:3142:
Err:3 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease
  Unable to connect to 192.168.40.97:3142:
Err:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Could not connect to 192.168.40.97:3142 (192.168.40.97). - connect (111: Connection refused)
Reading package lists... Done                   
Building dependency tree       
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not connect to 192.168.40.97:3142 (192.168.40.97). - connect (111: Connection refused)
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Unable to connect to 192.168.40.97:3142:
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Unable to connect to 192.168.40.97:3142:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Could not connect to 192.168.40.97:3142 (192.168.40.97). - connect  (111: Connection refused)
W: Some index files failed to download. They have been ignored, or old ones used instead.

What should be done to remove the proxy? I'm using it on Ubuntu 16.04

Linux ssl-60 4.10.0-42-generic #46~16.04.1-Ubuntu SMP Mon Dec 4 15:57:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

  • My suspicion is that a reboot would fix this, but there is probably an easier way. – Retr0id Jan 6 '18 at 17:54
  • Reboot didn't help – rajeev_r_menon Jan 6 '18 at 17:54
  • You may have configured the proxy somewhere else. – Rui F Ribeiro Jan 6 '18 at 17:55
  • I don't remember adding any configuration anywhere else. If I did, do you know where it could've been done? – rajeev_r_menon Jan 6 '18 at 18:14
  • it has to be under /etc/apt – Rui F Ribeiro Jan 6 '18 at 18:39
2

check if there is a line containing the word Proxy in this file /etc/apt/apt.conf.d/70debconf

and if the word Proxy is present, delete the line and after run the command apt update

source: https://wiki.debian.org/AptConf

|improve this answer|||||
0

If you do not want apt-get to use a proxy, use apt-get as:

sudo apt-get -o Acquire::http::proxy=false <update/install> 
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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