删除代理后无法apt更新

删除代理后无法apt更新

192.168.40.97:3142我在使用中安装了一个 apt 缓存服务器apt-cacher-ng。为了在我的笔记本电脑上使用它,我02proxy/etc/apt/apt.conf.d目录中添加了一个文件,其中包含以下内容。

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

但后来我想使用没有代理的 apt,因为服务器有一些问题。所以我删除了该02proxy文件并尝试了apt update。但它仍在尝试连接到服务器。

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.

应该怎么做才能删除代理?我在 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

答案1

Proxy检查此文件中 是否有包含该单词的行/etc/apt/apt.conf.d/70debconf

如果该单词Proxy存在,请删除该行,然后运行命令apt update

来源:https://wiki.debian.org/AptConf

答案2

如果您不想apt-get使用代理,请使用apt-get

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

相关内容