ubuntu之sudo apt-get update提示Could not connect to 127.0.0.1:8081 (127.0.0.1)解决办法

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u011068702/article/details/81291904

1、问题

由于要使用Git,需要执行

sudo apt-get install git

但是执行之前我需要先

sudo apt-get update

麻痹的,当我执行这个的时候错误提示如下

Could not connect to 127.0.0.1:8081 (127.0.0.1). - connect (111: Connection refused)

Err:1 http://archive.canonical.com/ubuntu xenial InRelease
  Could not connect to 127.0.0.1:8081 (127.0.0.1). - connect (111: Connection refused)
Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease
  Could not connect to 127.0.0.1:8081 (127.0.0.1). - connect (111: Connection refused)
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Unable to connect to 127.0.0.1:8081:
Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
  Unable to connect to 127.0.0.1:8081:
Err:5 http://archive.ubuntu.com/ubuntu xenial-security InRelease
  Unable to connect to 127.0.0.1:8081:
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not connect to 127.0.0.1:8081 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Unable to connect to 127.0.0.1:8081:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Unable to connect to 127.0.0.1:8081:
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/xenial/InRelease  Could not connect to 127.0.0.1:8081 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Unable to connect to 127.0.0.1:8081:
W: Some index files failed to download. They have been ignored, or old ones used instead.

很痛苦,有木有,不知道啥原因

 

 

 

 

 

2、思考思路

不就是 在linux上安装git吗?百度安装方法,一般2种,一个

sudo apt-get install git

一个下载git源码然后编译,特么的看到别人的命令,敲着敲着make的时候找不到.o文件,日了狗,都有想杀人的冲动的了,还是用

sudo apt-get install git这个方法,但是麻痹的,sudo apt-get update和直接安装git命令提示上面的错误

我特么以为是源的问题,然后又到网上找ubuntu 16的源,特码的替换了n个还是一个鸟样,心灰意冷.最后认认真真分析错误日志,然后再去把

Could not connect to 127.0.0.1:8081 (127.0.0.1)

放到网上去,虽然有点类似但是,但是给了我思路啊,不就是连接不上120.0.0.1:8081吗?估计是设置了代理导致.特码的.

 

 

 

 

 

3、解决办法

找到"setting" -> "system setting" -> "Network" 去掉这个鸟代理就行了

改变Manual模式为None

 

 

 

 

 

 

 

4、总结

遇到问题不要乱鸡巴猜,不然找不到问题本质,需要耐心看错误日志,比如这里最关键的信息是

Could not connect to 127.0.0.1:8081 (127.0.0.1)

特么万一没思路拷贝这个错误到百度去,说不定柳暗花明

展开阅读全文

没有更多推荐了,返回首页