环境:ubuntu18.04,apt source使用阿里源,经过 apt-get 安装模块或者 update 的时候出现,提示错误:ubuntu
解决方法:vim
sudo vim /etc/gai.conf
spa
找到code
# 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
以前的 # 号便可。blog
解释:只使用ipv4,参考:https://www.iteye.com/blog/jiajianchao-gmail-com-1597253ip