Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/feed-rss2.php on line 8
Force Apt-Get to IPv4 or IPv6 on Ubuntu or Debian – AKLWEB HOST LLC Support Center https://support.aklwebhost.com Fri, 27 Dec 2019 07:32:31 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.4 Force Apt-Get to IPv4 or IPv6 on Ubuntu or Debian https://support.aklwebhost.com/knowledgebase/force-apt-get-to-ipv4-or-ipv6-on-ubuntu-or-debian/ https://support.aklwebhost.com/knowledgebase/force-apt-get-to-ipv4-or-ipv6-on-ubuntu-or-debian/#respond Fri, 27 Dec 2019 07:32:31 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=2934 Here on AKLWEB Host, we have the option to enable IPv6 on all deployable VPSes. But with this, some programs and commands may prefer one or the other with unpredictable results.

In this guide, we will configure apt-get to use only IPv4 or IPv6. This guide targets Ubuntu 14.04 and Debian Jessie, but may work for newer versions as well.

Fast command line option

If you want to force the apt-get to use IPv4 or IPv6 only one time, follow these steps. This feature is available after the 0.9.7.9~exp1 version of apt-get. First, make sure your version of apt-get is newer than 0.9.7.9~exp1 by running the following command:

apt-get --version

The result will be something like this:

apt 1.0.1ubuntu2 for amd64 compiled on Oct 28 2014 20:55:14

If the version checks out, then you can force IPv4 with:

apt-get -o Acquire::ForceIPv4=true update

or IPv6:

apt-get -o Acquire::ForceIPv6=true update

This will update the repositories resolving the URLs in sources.list to IPv4 only.

Persistent option

To make the setting persistent, create the file 99force-ipv4 in /etc/apt/apt.conf.d/.

sudoedit /etc/apt/apt.conf.d/99force-ipv4

Put the following contents in it:

Acquire::ForceIPv4 "true";

Save the file, and you’re good to go. If you want to force IPv6 instead, change the 4 to 6 in the file name and settings. To choose between one of them, test with the fast method and see which works better.

]]>
https://support.aklwebhost.com/knowledgebase/force-apt-get-to-ipv4-or-ipv6-on-ubuntu-or-debian/feed/ 0