t is possible that I can forces my apt-get command /apt command only use IPv6 or Ipv4 transport on a Debian or Ubuntu Linux?
server?
Yes. You need to configure the acquire group option on a Debian or Ubuntu Linux. The Acquire group of options controls the download of packages as well as the various “acquire methods” responsible for the download itself as follows:
ADVERTISEMENTS
Of course you need properly configured IPv6 based system with support from your router and ISP too otherwise you might see or have to wait for a some timeout whenever you are try downloading updates:
Fig.01: How to force apt-get to use IPv4 or IPv6 on Ubuntu or Debian Linux to avoid timeouts
The apt-get syntax for the Acquire group is:
apt-get -o Acquire::option command
apt-get -o Acquire::option=value command
apt-get -o Acquire::option=value install pkg1
apt-get -o Acquire::option=value update
apt-get -o Acquire::option=value upgrade
apt-get -o Acquire::option=value dist-upgrade
In this example, force IPv4 transport:
sudo apt-get -o Acquire::ForceIPv4=true install pkg
sudo apt-get -o Acquire::ForceIPv4=true update
sudo apt-get -o Acquire::ForceIPv4=true upgrade
sudo apt-get -o Acquire::ForceIPv4=true dist-upgrade
sudo apt-get -o Acquire::ForceIPv4=true install ksh
In this example, force IPv6 transport:
sudo apt-get -o Acquire::ForceIPv6=true install pkg
sudo apt-get -o Acquire::ForceIPv6=true update
sudo apt-get -o Acquire::ForceIPv6=true upgrade
sudo apt-get -o Acquire::ForceIPv6=true dist-upgrade
sudo apt-get -o Acquire::ForceIPv6=true install ksh
#ubuntu