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

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

 

解决方法:

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

相关文章:

  • 2021-11-13
  • 2021-06-04
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2021-08-29
  • 2021-06-30
猜你喜欢
  • 2021-09-04
  • 2022-12-23
  • 2021-04-20
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
相关资源
相似解决方案