How to fix Kali Linux apt-get slow update?

This is a small guide on How to fix Kali Linux apt-get slow update.
How to fix Kali apt-get slow update - blackMORE Ops
Kali is relatively new and got fewer Mirrors than some other distro’s. That means less servers to download from and less servers means more people trying to download from them and using all bandwidth. So when you type in apt-get update, you see a slow download speed for packages. This just means you’re connected to a server that’s really busy. Some users complains that nothing happens or they are not getting any updates at all. Some got different issues like update stuck is header and doesn’t move any further.

To fix this, you need to check a few things:

  1. Check if you have the right repositories is your /etc/apt/sources.list
  2. Remove unwanted or unsupported repositories.
  3. Clean apt-get cache.
  4. Choose a fast DNS server.

To fix sources.list, follow this guide: How to add official Kali Linux Repositories?

To switch repositories to a different mirror of your choice, follow this guide: How to change repositories to a different mirror?

Clean apt-get cache:

apt-get clean

Choose a proper DNS server:

Edit resolv.conf file:

leafpad /etc/resolv.conf

Enter Google DNS nameservers

Following two are Google DNS, let’s face it, if Google is broken, we all think Internet is broken. Hence the reason of using Google DNS. You can choose other DNS Server if you want that are fast and reliable.

nameserver 8.8.8.8
nameserver 8.8.4.4

Now save and close the file.

Test your changes

Let put our changes to the test..

Do an apt-get update

 apt-get update

Do and upgrade

 apt-get upgrade

Finally do a distribution upgrade

 apt-get dist-upgrade

Your download speed should be a lot better than you were getting previously.

Another solution, changing from HTTP to REPO in sources.list file (14/02/2014)

One of the readers advised that by changing the repositories from HTTP to REPO, he gained significant speed up. See Sameer Barha’s comment below.

Use the following repositories (update your sources.list file)

## Kali Regular repositories
deb http://repo.kali.org/kali kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free
## Kali Source repositories
deb-src http://repo.kali.org/kali kali main non-free contrib
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free

Instead of

## Kali Regular repositories
deb http://http.kali.org/kali kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free
## Kali Source repositories
deb-src http://http.kali.org/kali kali main non-free contrib
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free

This change seems to boost speed as it uses slightly different repo than the usual HTTP servers which are overloaded. Let us know how this worked for you.

In case your sources.list file is messed up or you’re just not sure, what to put on there, follow these instruction’s to add official Kali Linux Repositories.

(Note: The above mentioned repositories are a slightly variant of the official one, you can choose either as they are both from Kali.org)

In case your DNS server is picking up (even Google’s DNS server) a repository from a different country(or avoid a specific country) and you would like to manually switch repositories to a different mirror of your choice(say in same country or just something you know working faster, follow these instruction to change repositories to a different mirror.

Thanks for reading. Please comment your experience to make this guide better. If you’ve found this useful, share and follow us on Facebook/Twitter.

Check Also

Enabling AMD GPU for Hashcat on Kali Linux: A Quick Guide

Enabling AMD GPU for Hashcat on Kali Linux: A Quick Guide

If you’ve encountered an issue where Hashcat initially only recognizes your CPU and not the …

How to fix You can’t access this shared folder because your organization’s security policies block unauthenticated guest access error on Windows 11

If you have the following error on Windows 11 “You can’t access this shared folder …

35 comments

  1. Changing from http to repo made a huge difference !!

  2. Dud you are awsm ?

  3. Thanks for the repo instead of http it works like charm to me

  4. Thanxx Man The Second Method Is worked For mee thanks alot

  5. Thanks! Changing http to repo sources really helped!

  6. Repo rocks.. changed apt-get speed from sluggish b/s to 1mb/s

  7. thanks for the info. still hovering between 3 KB/s and 4KB/s, with estimates between 11 hours and 1+ days for 25MB (on a 8Mb connection in Bangkok). i let it run all night last night, but the net (which is always spotty) got disconnected at some point. … oh well.

  8. imtheblacklight

    holy s*** it worked gr8…… updating the sources.list was awesum trick

  9. Changing http to repo was awesome for me :) thanks for this nice shares :)

    Here I am looking forward for another guidance such as:
    1. Is it possible to auto update the content of /etc/resolv.conf?
    2. What should I do to always obtain the fastest and reliable DNS Server and how to auto write them to /etc/resolv.conf frequently?

    Thanks

    • sudo apt-get install resolvconf

      Once you have made sure that the resolvconf is installed, edit the configuration file using the following command:

      sudo leafpad /etc/resolvconf/resolv.conf.d/base

      and write
      domain-name-servers 8.8.8.8
      domain-name-servers 8.8.4.4

      Save it. Now the settings in resolv.conf will be permanent.

  10. THANKX MATE … speed shot up from a measely 10 kb/s to 290 kb/s … I used the REPO trick .. awesome

  11. hi,
    I have 2 graphic cards – a built in INTEL and AMD athlon 8000 series,can i follow this method of installation of drivers without causing ambiguity for the OS as to which card to boot from ??

  12. Well changing to repo just works, was wasting my time before! Thanks a bunch!

  13. Thanks a lot!! Changing HTTP to repo worked for me yet again http://security.kali.org/kali-security/ kali/updates/main was slow…

  14. Awesome Man!! Picked Up Speed combining Google DNS Servers nd “repo” made my day :) :D
    Thank U blackMORE Ops nd also Sameer

  15. Changing http to repo sources really helped me , thanks a lot man :D

  16. The DNS change worked for me. Thanks ! : )

  17. It was good. and very much thanks to you to help me starting to use kali linux.
    Please add more posts for beginners. Thanks in advance.

  18. do i add nameserver 8.8.8.8 and nameserver 8.8.4.4 and delete nameserver 192.168.1.254

  19. http to repo solved it for me. thanks!

  20. I am behind a proxy. What you told didn’t work for me. What should I do?

  21. That http to repo worked like a charm for me in Kali 2016.1, it still works ;D
    from 10kb/s to 150kb/s

  22. Changing to repo worked like a charm for me. Thanks.

  23. i have this message after apt-get update
    failed to fetch http://security.kali.org/kali-security/dists/sana/updates/main/source/Sources

  24. Changing from http to repo fixed my could not resolve issues. THANKS!!!

  25. Changing from http to repo fixed my could not resolve issues. THANKS!!!

  26. Changing from http to repo was the Solution for me, estimated time went down from about 2 hours to under 10 minutes. Thank you!

  27. Holy-
    It works like a charm. Thanks for sharing this.
    Site bookmarked! :)

  28. Thanks 2nd Method Worked!

  29. Transporting repositories from http mirrors to https is working now

  30. root@kali:~# apt install apt-transport-https

    Also change it in etc/apt/sources.list

    deb https://http.kali.org/kali kali-rolling main non-free contrib

    • I have been running apt-get distro-upgrade for hours. The mirror from kali.download/kali runs great but when it switched to any other mirror my speed drops to b/s. I tried many things on many different websites but this comment was what actually worked. Jumped up to 250+ MB/s. Thank you!

  31. thank you . changing http to repo save me a lot :-D from 100kbps to 600kbps download

Leave your solution or comment to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from blackMORE Ops

Subscribe now to keep reading and get access to the full archive.

Continue reading

Privacy Policy on Cookies Usage

Some services used in this site uses cookies to tailor user experience or to show ads.