I am trying to update repositories using following command but it is failing:
sudo apt-get update
Here is the output of above command:
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.
Following is my /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
Looks like it's trying to connect over
IPv6
for some reason: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)
Unless you have this box connected to a network that supports
IPv6
, then it's not going to be able to connect to thatIPv6
address. To forceIPv4
forapt-get
, pass in option:-o Acquire::ForceIPv4=true
.For example:
sudo apt-get -o Acquire::ForceIPv4=true update sudo apt-get -o Acquire::ForceIPv4=true install procps
Source: https://unix.stackexchange.com/a/100887/7688
Disclaimer: I am not a Debian person (much more familiar with Ubuntu / RHEL / CentOS), so I'm not sure why Debian is defaulting to
IPv6
, but until most ISPs support this then it's most assuredly not going to work. You might want to figure out how to set the system to preferIPv4
for the time being. I tried setting this on a Debian Wheezy VM, but with limited success. It appears the way to overrideIPv4
/IPv6
precedence is with/etc/gai.conf
:Uncomment the line
precedence ::ffff:0:0/96 100
in/etc/gai.conf
:sed -i -e 's|^#precedence ::ffff:0:0/96 100|precedence ::ffff:0:0/96 100|' /etc/gai.conf
http://http.debian.net doesn't serve directly, it just redirects you to a mirror. It tries to be smart about it and send you to a "close" one. See the actual web page at http://http.debian.net/ for details, and http://rgeissert.blogspot.co.nz/p/httpdebiannet-faq.html for some additional details.
Either way, the problem is that you don't have IPv6 connectivity to ftp.tr.debian.org at the time you tried; it could be that the mirror is (was) down, or that there's a problem with your IPv6 networking connectivity.
Either wait a bit and try again (hopefully getting a different mirror, or finding that the transient issue has gone away) or specify an explicit specific mirror in your apt sources instead of the redirector.