amcdonley
Posts: 202
Joined: Mon Jan 26, 2015 5:56 pm
Location: Florida, USA

sudo apt-get update uses IPv6 - have to force IPv4 to succeed

Wed Nov 01, 2017 2:39 am

I successfully installed 2017-09-17-stretch (full) headless with wpa_supplicant.conf:

Code: Select all

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="MYWIFISSID"           
    psk="MY11CHARPASSKEY"
    key_mgmt=WPA-PSK
}
When I try to update, it is using IPv6

Code: Select all

$ sudo apt-get update
0% [Connecting to mirrordirector.raspbian.org (2a00:1098:0:80:1000:75:0:3)] [Connecting to archive.raspberrypi.org (2a00:1098:0:82:1000:13:0:9)]
which changes to:

Code: Select all

Ign:1 http://mirrordirector.raspbian.org/raspbian stretch InRelease                                                                             
Err:2 http://mirrordirector.raspbian.org/raspbian stretch Release                                                                               
  404  Not Found [IP: 93.93.128.193 80]
0% [Connecting to archive.raspberrypi.org (2a00:1098:0:82:1000:13:0:7)]
and never completes.

If I force IPv4 it seems ok. I've never had to do this with before. Any clues as to why?

Code: Select all

sudo apt-get sudo apt-get -o Acquire::ForceIPv4=true upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@RWPi:~ $ 

mdsh
Posts: 4
Joined: Sun Jan 13, 2013 10:02 am

Re: sudo apt-get update uses IPv6 - have to force IPv4 to succeed

Thu Jul 05, 2018 5:57 am

Over 6 months later and this is still a problem.

Code: Select all

$ sudo apt update
Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]                                   
Ign:1 http://archive.raspberrypi.org/debian stretch InRelease                                                          
Get:4 http://archive.raspberrypi.org/debian stretch Release [24.8 kB]                                                  
Err:4 http://archive.raspberrypi.org/debian stretch Release                                                            
  Connection timed out [IP: 2a00:1098:0:80:1000:13:0:6 80]
Reading package lists... Done
E: The repository 'http://archive.raspberrypi.org/debian stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Works correctly when forcing IPv4.

Code: Select all

$ sudo apt -o Acquire::ForceIPv4=true update
Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB]
Hit:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease        
Get:3 http://archive.raspberrypi.org/debian stretch/main armhf Packages [161 kB]     
Get:4 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [37.2 kB]                             
Fetched 224 kB in 4s (55.6 kB/s)                                                                            
Reading package lists... Done
Building dependency tree       
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
I have perfect native IPv6 connectivity.

Code: Select all

$ traceroute6 2a00:1098:0:80:1000:13:0:6
traceroute to 2a00:1098:0:80:1000:13:0:6 (2a00:1098:0:80:1000:13:0:6), 30 hops max, 80 byte packets
 1  2a02:8011:XXXX::26 (2a02:8011:XXXX::26)  1.646 ms  1.211 ms  0.551 ms
 2  2a02:8011:XXXX::30 (2a02:8011:XXXX::30)  1.842 ms  1.253 ms  0.884 ms
 3  2a02:8010::4:0:0:6 (2a02:8010::4:0:0:6)  5.241 ms  5.672 ms  6.469 ms
 4  2a02:8010:0:404::16 (2a02:8010:0:404::16)  9.436 ms  9.086 ms  8.721 ms
 5  2a00:1098:2::5d5d:8529 (2a00:1098:2::5d5d:8529)  11.046 ms  10.691 ms  10.331 ms
 6  lb-sov-1.raspberrypi.org (2a00:1098:0:80:1000:13:0:6)  11.520 ms  5.283 ms  5.840 ms
This issue is not limited to one machine.

Please fix.
--
Mark Himsley

amcdonley
Posts: 202
Joined: Mon Jan 26, 2015 5:56 pm
Location: Florida, USA

Re: sudo apt-get update uses IPv6 - have to force IPv4 to succeed

Thu Jul 05, 2018 12:05 pm

Just a thought: what happens if you use Google DNS server?

neilparker62
Posts: 7
Joined: Sat Nov 21, 2020 5:24 pm

Re: sudo apt-get update uses IPv6 - have to force IPv4 to succeed

Mon Jan 18, 2021 8:59 am

I am also having this problem. Can you please advise if there's an option one can use to force ipv4 only servers when using apt-get intall. Using google nameservers did not seem to make any difference.

amcdonley
Posts: 202
Joined: Mon Jan 26, 2015 5:56 pm
Location: Florida, USA

Re: sudo apt-get update uses IPv6 - have to force IPv4 to succeed

Mon Jan 18, 2021 1:00 pm

You can force everything to IPv4 by:

=== disable ipv6

$ sudo cp /boot/cmdline.txt /boot/cmdline.txt.bak
$ sudo nano cmdline.txt
add to end of line (with a space before this new item):

ipv6.disable=1

ctrl-x, y,

sudo reboot

Return to “Troubleshooting”