To use apt-get with a specific IP transport (IPv4 or IPv6) on Ubuntu, Debian, or Mint Linux, you can modify the default configuration file at /etc/apt/apt.conf.d/00apt-transport-https
to include the following line:
Acquire::ForceIPv4 "true"; # For IPv4
Acquire::ForceIPv6 "true"; # For IPv6
Note that only one of the above lines should be uncommented, depending on whether you want to use IPv4 or IPv6. The apt-get update
command will then use the specified IP transport to communicate with the package repositories.
Keep in mind that forcing apt-get to use a specific IP transport may cause connectivity issues if the specified transport is not available or if the package repositories are not reachable using that transport.