Ubuntu 15.10 中 apt-get 出现问题

Ubuntu 15.10 中 apt-get 出现问题

当我尝试运行 apt update 时遇到这样的问题:

Ign archive.ubuntu.com wily InRelease
Ign archive.ubuntu.com wily-updates InRelease                           
Ign archive.ubuntu.com wily-backports InRelease                         
Ign archive.ubuntu.com wily-security InRelease                          
Err archive.ubuntu.com wily Release.gpg                                 
  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
Err archive.ubuntu.com wily-updates Release.gpg                         
  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
Err archive.ubuntu.com wily-backports Release.gpg                       
  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
Err archive.ubuntu.com wily-security Release.gpg                        
  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]

我试图找出问题所在,但没有找到答案。PS:我不使用代理。

答案1

要在 Ubuntu 下禁用 IPv6 支持,请编辑以下文件:/etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6=1  
net.ipv6.conf.default.disable_ipv6=1  
net.ipv6.conf.lo.disable_ipv6=1

添加这些行将禁用 IPv6 支持(在环回中),这是所有可用 etginterfaces 的默认设置。您需要重新启动网络接口:

/etc/init.d/networking restart

相关内容