sudo apt-get update 不起作用无法连接到 192.168.1.254:3128

sudo apt-get update 不起作用无法连接到 192.168.1.254:3128

通常(但并非总是)当我尝试下载一些软件时,apt错误日志中会出现很多错误,例如以下错误:

Err http://fr.archive.ubuntu.com trusty/universe Translation-fr                
  Unable to connect to 192.168.1.254:3128:

或者

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Unable to connect to 192.168.1.254:3128:

有人说这是因为代理,但我不使用代理。

我做到了:

:~$ apt-config dump acquire::http
Acquire::http "";
Acquire::http::proxy "http://192.168.1.254:3128/";

:~$ grep 192.168.1.254 /etc/apt/ -R
/etc/apt/apt.conf:Acquire::http::proxy "http://192.168.1.254:3128/";
/etc/apt/apt.conf:Acquire::https::proxy "https://192.168.1.254:3128/";
/etc/apt/apt.conf:Acquire::ftp::proxy "ftp://192.168.1.254:3128/";
/etc/apt/apt.conf:Acquire::socks::proxy "socks://192.168.1.254:3128/";
grep: /etc/apt/trustdb.gpg: Permission denied

答案1

从输出中可以看出,您正在使用代理。如果您不需要,请删除该配置:

sudo sed -i '/192.168.1.254:3128/d' /etc/apt/apt.conf

相关内容