我正在尝试使用下面的命令来更新存储库,但它是失败的:
sudo apt-get update
以上是上述命令的输出:
Hit http://dl.google.com stable Release.gpg Hit http://deb.opera.com stable Release.gpg Hit http://liveusb.info all Release.gpg Hit http://dl.google.com stable Release Hit http://deb.opera.com stable Release Hit http://liveusb.info all Release Hit http://dl.google.com stable/main i386 Packages Hit http://repo.mysql.com wheezy Release.gpg Hit http://linux.dropbox.com wheezy Release.gpg Hit http://deb.opera.com stable/non-free i386 Packages Hit http://liveusb.info all/main i386 Packages Hit http://security.debian.org wheezy/updates Release.gpg Get:1 http://http.debian.net wheezy Release.gpg [1,655 B] Hit http://linux.dropbox.com wheezy Release Hit http://security.debian.org wheezy/updates Release Hit http://repo.mysql.com wheezy Release Hit http://linux.dropbox.com wheezy/main i386 Packages Hit http://security.debian.org wheezy/updates/main i386 Packages Get:2 http://http.debian.net wheezy Release [168 kB] Hit http://repo.mysql.com wheezy/mysql-apt-config i386 Packages Hit http://security.debian.org wheezy/updates/main Translation-en Ign http://dl.google.com stable/main Translation-en_US Ign http://deb.opera.com stable/non-free Translation-en_US Ign http://dl.google.com stable/main Translation-en Ign http://liveusb.info all/main Translation-en_US Ign http://deb.opera.com stable/non-free Translation-en Ign http://liveusb.info all/main Translation-en Get:3 http://http.debian.net wheezy/main i386 Packages [5,858 kB] Ign http://linux.dropbox.com wheezy/main Translation-en_US Ign http://linux.dropbox.com wheezy/main Translation-en Get:4 http://http.debian.net wheezy/main Translation-en [3,846 kB] Ign http://repo.mysql.com wheezy/mysql-apt-config Translation-en_US Ign http://repo.mysql.com wheezy/mysql-apt-config Translation-en Err http://http.debian.net wheezy-updates Release.gpg Cannot initiate the connection to ftp.tr.debian.org:80 (2001:a98:11::100). - connect (101: Network is unreachable) [IP: 2001:a98:11::100 80] Get:5 http://http.debian.net wheezy-updates Release [124 kB] Err http://http.debian.net wheezy-updates/main Translation-en Err http://http.debian.net wheezy-updates/main Translation-en Get:6 http://http.debian.net wheezy-updates/main i386 Packages [3,397 B] Err http://http.debian.net wheezy-updates/main Translation-en Err http://http.debian.net wheezy-updates/main Translation-en Err http://http.debian.net wheezy-updates/main Translation-en Cannot initiate the connection to ftp.tr.debian.org:80 (2001:a98:11::100). - connect (101: Network is unreachable) [IP: 2001:a98:11::100 80] Fetched 10.0 MB in 1min 5s (152 kB/s) W: Failed to fetch http://http.debian.net/debian/dists/wheezy-updates/Release.gpg Cannot initiate the connection to ftp.tr.debian.org:80 (2001:a98:11::100). - connect (101: Network is unreachable) [IP: 2001:a98:11::100 80] W: Failed to fetch http://http.debian.net/debian/dists/wheezy-updates/main/i18n/Translation-en Cannot initiate the connection to ftp.tr.debian.org:80 (2001:a98:11::100). - connect (101: Network is unreachable) [IP: 2001:a98:11::100 80] E: Some index files failed to download. They have been Ignored, or old ones used instead.
以下是我的/etc/apt/sources.list
# deb cdrom:[Debian GNU/Linux 7 _Wheezy_ - Official Snapshot i386 LIVE/INSTALL Binary 20140716-13:13]/ wheezy contrib main contrib non-free non-free deb http://http.debian.net/debian wheezy main contrib non-free deb-src http://http.debian.net/debian wheezy main contrib non-free deb http://http.debian.net/debian wheezy-updates main contrib non-free deb-src http://http.debian.net/debian wheezy-updates main contrib non-free deb http://security.debian.org/ wheezy/updates main contrib non-free deb-src ftp://ftp2.de.debian.org/debian/ wheezy/updates main contrib non-free ## Depôt MultiSystem deb http://liveusb.info/multisystem/depot all main # deb http://http.us.debian.org/debian/ wheezy contrib non-free main
http://http.debian.net不直接提供服务,只是将你redirect到镜像。 它试图聪明,把你送到一个“亲密的”。 有关详细信息,请参阅http://http.debian.net/上的实际网页,并参阅http://rgeissert.blogspot.co.nz/p/httpdebiannet-faq.html获取更多详细信息。
无论哪种方式,问题是你在尝试的时候没有到ftp.tr.debian.org的IPv6连接。 可能是镜像已经closures,或者您的IPv6networking连接有问题。
要么等一下,然后再试一次(希望得到一个不同的镜像,或者发现暂时的问题已经消失),或者在apt源代码中指定一个明确的特定镜像而不是redirect器。
看起来它试图通过IPv6连接出于某种原因:
Cannot initiate the connection to ftp.tr.debian.org:80 (2001:a98:11::100). - connect (101: Network is unreachable) [IP: 2001:a98:11::100 80] Fetched 10.0 MB in 1min 5s (152 kB/s)
除非您将此盒连接到支持IPv6的networking,否则无法连接到该IPv6地址。 要强制IPv4为apt-get ,请传入选项: -o Acquire::ForceIPv4=true 。
例如:
sudo apt-get -o Acquire::ForceIPv4=true update sudo apt-get -o Acquire::ForceIPv4=true install procps
来源: https : //unix.stackexchange.com/a/100887/7688
免责声明:我不是Debian的人(对Ubuntu / RHEL / CentOS更熟悉),所以我不确定为什么Debian是默认的IPv6 ,但是直到大多数ISP支持这个,那么它肯定是不会工作的。 你可能想弄清楚如何设置系统暂时偏好IPv4 。 我试图在Debian Wheezy VM上设置这个,但是成功有限。 看来覆盖IPv4 / IPv6优先级的方法是使用/etc/gai.conf :
在/etc/gai.conf取消注释line precedence ::ffff:0:0/96 100 :
sed -i -e 's|^#precedence ::ffff:0:0/96 100|precedence ::ffff:0:0/96 100|' /etc/gai.conf