How to restrict apt-get to IPv4 or IPv6 download

Source: Internet
Author: User
Tags linux mint

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.