Home TutorialsHow toHow to fix Kali Linux apt-get slow update?

How to fix Kali Linux apt-get slow update?

by blackMOREOps
How to fix Kali apt-get slow update - blackMORE Ops

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 https://repo.kali.org/kali kali main non-free contrib
deb https://security.kali.org/kali-security kali/updates main contrib non-free
## Kali Source repositories
deb-src https://repo.kali.org/kali kali main non-free contrib
deb-src https://security.kali.org/kali-security kali/updates main contrib non-free

Instead of

## Kali Regular repositories
deb https://http.kali.org/kali kali main non-free contrib
deb https://security.kali.org/kali-security kali/updates main contrib non-free
## Kali Source repositories
deb-src https://http.kali.org/kali kali main non-free contrib
deb-src https://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.


Discover more from blackMORE Ops

Subscribe to get the latest posts sent to your email.

You may also like

35 comments

Marcus Lee March 15, 2016 - 1:52 pm

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

Reply
J04c Fu457 September 10, 2016 - 8:40 pm

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

Reply
milad September 21, 2016 - 4:31 am

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

Reply
bob January 27, 2017 - 12:51 am

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

Reply
don January 28, 2017 - 3:21 am

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

Reply
Martin July 13, 2017 - 10:49 pm

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

Reply
Xnehaxixh October 6, 2017 - 7:49 pm

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

Reply
Kirraa November 10, 2017 - 9:12 pm

Thanks 2nd Method Worked!

Reply
Anandesh Sharma December 21, 2017 - 5:05 pm

Transporting repositories from http mirrors to https is working now

Reply
Anandesh Sharma December 21, 2017 - 5:08 pm

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

Reply
ash April 8, 2019 - 12:59 pm

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!

Reply
secrret December 24, 2017 - 8:00 pm

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

Reply
1 2

Leave your solution or comment to help others. Comment don't need registration or real email, so feel free.

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