How to restrict apt-get to IPv4 or IPv6 download
If you want to manually control Debian or Ubuntu systems to update systems or software using apt-get using IPv4 or IPv6, you can configure the Acquire group option. The Acquire group has the following two options:
ForceIPv4: globally forced IPv4 download
ForceIPv6: globally forced IPv6 download
Of course, if you want to use IPv6, you need support from your carrier and vro and make the correct configuration on the operating system.
Method 1: manually specify
Apt-get global IPv4 usage example
1. sudo apt-get-o Acquire: ForceIPv4 = true install pkg
2. sudo apt-get-o Acquire: ForceIPv4 = true update
3. sudo apt-get-o Acquire: ForceIPv4 = true upgrade
4. sudo apt-get-o Acquire: ForceIPv4 = true dist-upgrade
5. sudo apt-get-o Acquire: ForceIPv4 = true install XXX
Apt-get Global IPv6 use example
1. sudo apt-get-o Acquire: ForceIPv6 = true install pkg
2. sudo apt-get-o Acquire: ForceIPv6 = true update
3. sudo apt-get-o Acquire: ForceIPv6 = true upgrade
4. sudo apt-get-o Acquire: ForceIPv6 = true dist-upgrade
5. sudo apt-get-o Acquire: ForceIPv6 = true install XXX
Method 2: configure the Bash alias
You can directly change the configuration file of the Bash Shell if you don't want to make it so difficult every time ~ /. Bashrc
# Use IPv6 ##
# Alias apt-get = 'sudo apt-get-o Acquire: ForceIPv6 = true'
# Use IPv4 ##
Alias apt-get = 'sudo apt-get-o Acquire: ForceIPv4 = true'
Method 3: Create the apt-get configuration file
If you want apt-get to use IPv6 forcibly, you can create the following configuration file:
/Etc/apt. conf. d/1000-force-ipv6-transport
And fill in the content
Acquire: ForceIPv6 "true ";
If you want apt-get to forcibly use IPv4, you can create the following configuration file:
Etc/apt. conf. d/1000-force-4-4-transport
And fill in the content
Acquire: ForceIPv4 "true ";
IPV6 address for Cisco CCIE Certification knowledge points
How to capture IPV6 data packets in WireShark
Use IPV6 source for traffic-free updates on Ubuntu 12.04 Campus Network
Build an IPV6 ftp server in Linux
CentOS IPV6 settings
Set Update source in CentOS pure IPV6 environment
How to disable CentOS 6 IPV6
How to disable IPv6 on Ubuntu, Linux Mint, and Debian
This article permanently updates the link address: