解决Unable to connect to archive.ubuntu.com问题

北慕城南 提交于 2019-12-01 16:58:25

环境:ubuntu18.04,apt source使用阿里源,通过 apt-get 安装模块或者 update 的时候出现,提示错误:

 

解决方法:

sudo vim /etc/gai.conf

找到

# precedence     
#    Add another rule to the RFC 3484 precedence table.  See section 2.1
#    and 10.3 in RFC 3484.  The default is:
#
#precedence  ::1/128       50
#precedence  ::/0          40
#precedence  2002::/16     30
#precedence ::/96          20
#precedence ::ffff:0:0/96  10
#
#    For sites which prefer IPv4 connections change the last line to
#
# 此处解开下行注释
#precedence ::ffff:0:0/96  100

删除 #precedence ::ffff:0:0/96 100 之前的 # 号即可。

解释:只使用ipv4,参考:https://www.iteye.com/blog/jiajianchao-gmail-com-1597253

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!