get apt-get stop using ipv6

8,547

I think I got to the root of your problem, the listed IPv6 address is invalid. Is there any chance you have configured IPv6 proxy (either http proxy or socks proxy) in your system? Because it looks like IPv6 address and port (8049).

You can check the environment variable http_proxy if it contains some value by doing:

echo $http_proxy

or check your network settings.

Another place where you could have the proxy defined is in the APT configuration which resides in /etc/apt/apt.conf file or /etc/apt/apt.conf.d/ directory. You should look for Acquire::http::Proxy "<URI>"; setting or written in the block:

Acquire
{
  http
  {
    Proxy "<URI>";
  };
};

Also remember when working with raw IPv6 addresses and URIs to enclose IPv6 address into brackets like this http://[2001:db8:dbb:1:1:1:1:221]:8049/

This might look similar:

# http_proxy=2001:db8:dbb:1:1:1:1:221:8049 apt-get update
Err http://ftp.cz.debian.org wheezy InRelease                             
Err http://security.debian.org wheezy/updates InRelease                   
Err http://ftp.cz.debian.org wheezy Release.gpg
  Could not resolve 'db8:dbb:1:1:1:1:221'
Err http://security.debian.org wheezy/updates Release.gpg
  Could not resolve 'db8:dbb:1:1:1:1:221'
Reading package lists... Done
W: Failed to fetch http://ftp.cz.debian.org/debian/dists/wheezy/InRelease  
W: Failed to fetch http://security.debian.org/dists/wheezy/updates/InRelease  
W: Failed to fetch http://ftp.cz.debian.org/debian/dists/wheezy/Release.gpg  Could not resolve 'db8:dbb:1:1:1:1:221'
W: Failed to fetch http://security.debian.org/dists/wheezy/updates/Release.gpg  Could not resolve 'db8:dbb:1:1:1:1:221'
W: Some index files failed to download. They have been ignored, or old ones used instead.

More general hints:

You can check the IPv6 configuration from the command line using the ip command:

Address:

# ip -6 a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2a01:5f0:1006::59bb:820d/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe6a:a954/64 scope link 
       valid_lft forever preferred_lft forever

and routes:

# ip -6 r s
2a01:5f0:1006::/64 dev eth0  proto kernel  metric 256 
fe80::/64 dev eth0  proto kernel  metric 256 
default via 2a01:5f0:1006::1 dev eth0  metric 1024 

Anyway since the normal modus of operation is to try the IPv6 address first and then fallback to IPv4, and this is not happening, you also should check your APT configuration for any hosts written as IPv6 address or hosts which do resolve only to IPv6 address (as already suggested by dobey). You might also want to check your /etc/hosts file, where you could have manually written a mapping from .deb archive hostname to IPv6-only address – you can verify this by pinging at the hostname(s) from your APT configuration (check /etc/apt/sources.list file and all files in /etc/apt/sources.list.d/ directory).

Also check your proxy (system or just APT) configuration, because it might creep in unexpected when you have long forgotten about this setting.

Share:
8,547

Related videos on Youtube

NaGeL182
Author by

NaGeL182

Updated on September 18, 2022

Comments

  • NaGeL182
    NaGeL182 over 1 year

    I'm trying to use apt-get update or any other apt-get command it gives me this error:

        Hiba történt „2001:db8:dbb:1:1:1:1:221:8049” feloldásakor 
        (-9 - A címcsalád a gépnévhez nem támogatott) 
    (google translate)
        There was an error "2001: db8: DBB: 1:1:1:1:221:8049" resolving 
        (-9 - Address family for hostname not supported)
    

    Which is strange because there is no Ipv6 anymore for that machine. There was before, but a router was removed which give it to it, and I removed the ipv6 association from the network configuration via GUI.

    Did i miss something?

    • dobey
      dobey about 11 years
      Do you have an entry in your apt's sources.list which contains an ipv6 address, or which contains a host for which a DNS server you're using returns an ipv6 address only?
    • oerdnj
      oerdnj about 11 years
      Also always please try to have the outputs in English if you ask this in general community. You can switch the output to the English by doing LANG=C apt-get update.
  • NaGeL182
    NaGeL182 about 11 years
    ip -6 a s and ip -6 r s doesnt give any responses back. and in my hosts file i have this: # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters and my sources.list doesnt have any ipv6 configuration and my sources.list.d is empty
  • oerdnj
    oerdnj about 11 years
    Also APT has it's own proxy configuration - you might want to check it too. (I'll edit the main answer when I get back to big computer.)
  • NaGeL182
    NaGeL182 about 11 years
    echo $http_proxy doesn't gives me anything. And how can I check my network setting(the proxy setting) via terminal? right now i dont have physical access to the server just SSH.
  • oerdnj
    oerdnj about 11 years
    Also try grep 2001:db8:dbb:1:1:1:1:221 -r /etc. It might find something somewhere.