setting should be respected - apt should not connect via ipv6
ipv6 is preferred - regardless of the setting
set prefer_ipversion=ipv4 on a ipv6 enabled system and watch apt connecting via ipv6
setting sysctl net.ipv6.conf.all.disable_ipv6=1 works around.
i suggest adding this to /etc/sysctl.d/ if ipv4 is set - for now only apt will not connect via ipv6.
Hmm so there are szenarios where you need IPv4 for some connections while IPv6 stays in place?
In dietpi-config you could completely disable the IPv6 kernel module. In the past this also added net.ipv6.conf.all.disable_ipv6=1 but we just removed that as it produced errors in log if the module was anyway not loaded.
I will have a look later if this somehow produces the error you face when IPv6 module stays enabled.
"for now only apt will not connect via ipv6." Just read about it: https://unix.stackexchange.com/questions/9940/convince-apt-get-not-to-use-ipv6-method
My impression is, that if you generally want to use IPv6 you should figure out why apt fails.
By using net.ipv6.conf.all.disable_ipv6=1 you anyway disable IPv6 for everything and in this case it makes mor sense (for me) to completely disable the kernel module, which can be done via dietpi-config.
@MichaIng my native ipv6 connection is fine. but i consider it as a bug because it effectively prevents the installation from finishing, as for some reason unknown to me the raspbian redirector does not respond in time. considering this an alternative may be to configure a connection timeout for apt and leave things as they are - which would still be confusing if users expect things to work as configurable in dietpi.txt.
https://github.com/Fourdee/DietPi/issues/1119 looks related to me.
Ah it's the default Raspbian redirector that fails on IPv6? I don't have IPv6 configured, so can't try to replicate it, I guess fourdee can.
Found another issue related to this:
Even that ipv6 module is blacklisted (which is what dietpi-config does on disabling IPv6), wget and apt sometimes (depending on repo) try to connect to IPv6 addresses. This was the case for me with owncloud installation via their own repo. I needed to adjust setting in /etc/.wgetrc to get repo key via wget and switching repo address from http to https somehow made apt choose IPv4.
Adding the sysctl setting mentioned in OP produces error if module is blacklisted but if it is the only way to force apt (and wget) to prefer IPv4, we should set it anyway.
Will investigate that further...
Close as this should have been solved by recent rework. Reopen on demand.
Most helpful comment
Close as this should have been solved by recent rework. Reopen on demand.