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

  1. ForceIPv4 : When downloading, force to use only the IPv4 protocol (must set to true).
  2. ForceIPv6 : When downloading, force to use only the IPv6 protocol (must set to true).

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 timeoutsFig.01: How to force apt-get to use IPv4 or IPv6 on Ubuntu or Debian Linux to avoid timeouts

My apt-get session hangs out as I am unable to reach to IPv6 address of security.ubuntu.com (2001:67c:1560:8001::14). In this quick tutorial, you will learn how to use apt-get command IPv4 instead of IPv6 address .Syntax to force apt-get with IPv4/IPv6 Transport

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

Forcing IPv4 transport with apt-get

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

Forcing IPv6 transport with apt-get

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

Force apt-get with IPv4/IPv6 transport address on Ubuntu/Debian
1.60 GEEK