Wednesday 12 July 2023

Prefer IPv4 for zypper updates

I had been battling server timeouts from a local mirror of OpenSUSE repositories when I noticed that if I telneted to the troublesome server it attempted to contact it via its IPv6 address. My Internet retailer doesn't support IPv6 connections, although my Linux distro and modem are capable. At the moment there's no need as there is no shortage of IPv4 addresses in this country.

A little search found that it's due to the curl library trying IPv6 addresses first. There is a little known environment variable to control this. I put

ZYPP_MEDIA_CURL_IPRESOLVE=4

in ~/.zypper.conf and I no longer had server timeouts.