前言与尝试
最近接手一块板子,需要装点东西,使用 sudp apt update
出现:
cannot connect to xxx, Unable to connect to localhost:{port}
在CSDN上查了相关资料,是代理的问题,但是使用像 unset proxy
、unset http_proxy
等命令均无效。
方法
参考:apt-get update fails due to “Unable to connect to localhost:8250” error
这块板子是 18.04
,所以有些地方与参考帖子不大一样。总的步骤如下:
sudo vi /etc/apt/apt.conf.d/00proxy
- 发现有
Acquire::http::proxy "localhost:{port}/";;
- 使用
#
注释或者删掉
完成。
若有帮助,还望点一个小小的暂,不胜感激。