Slow apt downloads? Try this solution to speed them up

Fast apt downloads

Ubuntu's software download and installation system is a system that I really like. Installing almost anything with a simple command without searching the internet is something that I have loved since I started using the operating system developed by Canonical. But it is not always perfect and this is something that is especially noticeable in the speed of apt downloads, that is, in the time we have to wait to update the servers, download software from repositories, etc.

If you are like me, surely you are wrong in thinking that the best way to speed up apt downloads is to go to "Software and updates" and choose a server that, in theory, will offer higher speeds, but no, this not only does not help, but sometimes it slows them down even more. Searching the internet a bit, I have come across a solution that seems to work and that I will explain next.

How to speed up apt downloads in Ubuntu

The problem is with IPv6. If we have it enabled, the recent network stack does not work as it should, especially when we try to update the apt servers. We can disable IPv6 from the network settings, but this is not enough. We have to disable IPv6 completely so that everything works smoothly and quickly.

To disable all IPv6, we have to do the following:

  1. We open a terminal and write the following command:
sudo nano /etc/sysctl.conf
  1. At the end of the text that appears, we add the following:

net.ipv6.conf.all.disable_ipv6=1
Net.ipv6.conf.default.disable_ipv6 = 1
Net.ipv6.conf.lo.disable_ipv6 = 1

  1. Next, we save the file and close the editor.
  2. Finally, we restart our connections with the following command:
sudo service networking restart

When the process is finished, we can verify that everything has worked correctly by executing the command sudo apt update, with which we should not see any problem and everything should be fluid. Also, when disabling IPv6 we can get other benefits, such as smoother browsing or Spotify stop freezing.

Have you managed to speed up apt downloads and / or other benefits by disabling IPv6?

Via: techrepublic.com


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Jhonatan said

    I think that when editing the file I deleted all the content that was in this

  2.   Jhojan jimenez said

    mm it helped me, but can you explain why ipv6 slows the internet? I'm not satisfied with just solving it plz: p

  3.   Friar Severus said

    It worked for me instead of "networking" "NetworkManager"