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

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
icyfire
  • 157
  • 1
  • 9

2 Answers2

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

D'Arcy Nader
  • 1,818
  • 2
  • 15
  • 20
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>