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

环境: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

posted @ 2019-10-17 19:59  walker_bin  阅读(3568)  评论(0编辑  收藏  举报