This is a conduct on How to modify repositories to a unlike mirror that applies to all Linux distributions. Often yous would experience the automobile selected mirror via GeoIP is non the fastest 1 of you’re only paranoid similar me who would desire to pick out a mirror from a specific country. This conduct would assistance yous to pick out mirrors manually together with command where yous download updates from. It powerfulness also assistance yous speed upward your download if yous care to pick out a skillful one.
I am non the master writer of this guide, g0tmi1k from Kali Forums wrote it together with it is a wonderful conduct on how to modify repositories to a unlike mirror.
I am redistributing this to arrive to a greater extent than available inwards search engines every bit I every bit good failed to notice a good written conduct on rank this. I am non fifty-fifty going to crusade to re-write anything every bit this Guide is only every bit good good. This was originally written for Kali Linux but whatsoever Linux user tin notice a mirror of their choice, together with supervene upon the links to betoken to their chosen mirror. Other distro users, experience gratis to move out a comment if yous ask help.
Original post link How to modify the repositories to a unlike official mirror. Again kudos to gotli1lk for this bully guide.
Related posts:
How to add together official Kali Linux Repositories?
How to cook Kali Linux apt-get tiresome update?
So hither goes..
How to modify repositories to a unlike mirror
There are several mirrors of the Kali Linux repository server, all of which are spread over the world.
Each fourth dimension yous interact amongst the repository, by default it volition automatically usage the mirror that is closest to you based on your geoip place (idea being, this volition give yous the best speed due to less latency).
For whatever reason, yous may wishing to manually force kali to usage a certain/different mirror rather than the 1 that is nearest you.
Warning: Doing so, if that mirror stops functioning, yous volition no longer have updates.
Find your mirror
To showtime with, yous tin see what mirror you’re using together with other ones nigh by, past times visiting this URL: http://http.kali.org/README.mirrorlist
For example:
Found 1 mirror which handle this country (GB):
http://ftp.hands.com/kali/README (gb, prio 100)
Found 5 mirrors in other countries, but same continent (EU):
http://ftp.free.fr/pub/kali/README (fr, prio 200)
http://mirror.pcextreme.nl/kali/README (nl, prio 200)
http://ftp.halifax.rwth-aachen.de/kali/README (de, prio 100)
http://kali.mirror.garr.it/mirrors/kali/README (it, prio 100)
http://ftp.cc.uoc.gr/mirrors/linux/kali/kali/README (gr, prio 100)
…So from the looks of it, inwards this instance ‘ftp.hands.com’ is beingness used. Lets switch to ‘kali.mirror.garr.it’
(there isn’t a argue or justification for this, only a server that was picked at random).
Make a backup of your sources.list file
Before making whatsoever modifications, its highly recommended that yous create a backup of whatsoever files that volition survive altered.
This tin survive done past times running:
root@kali $ cp -f /etc/apt/sources.list{,.bkup}
Change mirror inwards sources.list file
The default source.list file looks like:
root@kali $ cat /etc/apt/sources.list | grep -v '^#' | uniq
deb http://http.kali.org/kali kali primary non-free contrib
deb-src http://http.kali.org/kali kali primary non-free contrib
deb http://security.kali.org/kali-security kali/updates primary contrib non-free
root@kali $
Hint: Kali Linux sources.list Repositories
So nosotros volition supervene upon default values amongst ‘kali.mirror.garr.it’.
From: http – README.mirrorlist nosotros tin run into the base of operations HTTP URL is: kali.mirror.garr.it/mirrors/kali/
Before (default/original)
deb http://http.kali.org/kali kali primary non-free contrib
deb-src http://http.kali.org/kali kali primary non-free contrib
After (static mirror/manually altering)
deb http://kali.mirror.garr.it/mirrors/kali/ kali primary non-free contrib
deb-src http://kali.mirror.garr.it/mirrors/kali/ kali primary non-free contrib
From: security – README.mirrorlist nosotros tin run into the base of operations safety URL is: kali.mirror.garr.it/mirrors/kali-security/
Before (default/original)
deb http://security.kali.org/kali-security kali/updates primary contrib non-free
After (static mirror/manually altering)
deb http://kali.mirror.garr.it/mirrors/kali-security/ kali primary non-free contrib
Therefore nosotros tin make the switch to ‘kali.mirror.garr.it’ past times using the default values every bit a template, together with merging inwards the data above.
Example command:
echo '# kali.mirror.garr.it
deb http://kali.mirror.garr.it/mirrors/kali/ kali primary non-free contrib
deb-src http://kali.mirror.garr.it/mirrors/kali/ kali primary non-free contrib
deb http://kali.mirror.garr.it/mirrors/kali-security/ kali primary non-free contrib' > /etc/apt/sources.list
The number looks similar this:
root@kali: # echo '# kali.mirror.garr.it
> deb http://kali.mirror.garr.it/mirrors/kali/ kali primary non-free contrib
> deb-src http://kali.mirror.garr.it/mirrors/kali/ kali primary non-free contrib
>
> deb http://kali.mirror.garr.it/mirrors/kali-security/ kali primary non-free contrib' > /etc/apt/sources.list
root@kali: # cat /etc/apt/sources.list
# kali.mirror.garr.it
deb http://kali.mirror.garr.it/mirrors/kali/ kali primary non-free contrib
deb-src http://kali.mirror.garr.it/mirrors/kali/ kali primary non-free contrib
deb http://kali.mirror.garr.it/mirrors/kali-security/ kali primary non-free contrib
root@kali: #
Test your change
We tin together with then test it out past times doing ‘apt-get update’:
root@kali: # apt-get update
Get:1 http://kali.mirror.garr.it kali Release.gpg [836 B]
Get:2 http://kali.mirror.garr.it kali Release.gpg [836 B]
Get:3 http://kali.mirror.garr.it kali Release [21.1 kB]
Get:4 http://kali.mirror.garr.it kali Release [8,791 B]
Get:5 http://kali.mirror.garr.it kali/main Sources [7,531 kB]
Get:6 http://kali.mirror.garr.it kali/non-free Sources [117 kB]
Get:7 http://kali.mirror.garr.it kali/contrib Sources [55.5 kB]
Get:8 http://kali.mirror.garr.it kali/main i386 Packages [8,450 kB]
Get:9 http://kali.mirror.garr.it kali/non-free i386 Packages [115 kB]
Get:10 http://kali.mirror.garr.it kali/contrib i386 Packages [55.2 kB]
Get:11 http://kali.mirror.garr.it kali/main i386 Packages [284 kB]
Get:12 http://kali.mirror.garr.it kali/non-free i386 Packages [20 B]
Get:13 http://kali.mirror.garr.it kali/contrib i386 Packages [616 B]
Ign http://kali.mirror.garr.it kali/contrib Translation-en_GB
Ign http://kali.mirror.garr.it kali/contrib Translation-en
Ign http://kali.mirror.garr.it kali/main Translation-en_GB
Ign http://kali.mirror.garr.it kali/main Translation-en
Ign http://kali.mirror.garr.it kali/non-free Translation-en_GB
Ign http://kali.mirror.garr.it kali/non-free Translation-en
Ign http://kali.mirror.garr.it kali/contrib Translation-en_GB
Ign http://kali.mirror.garr.it kali/contrib Translation-en
Ign http://kali.mirror.garr.it kali/main Translation-en_GB
Ign http://kali.mirror.garr.it kali/main Translation-en
Ign http://kali.mirror.garr.it kali/non-free Translation-en_GB
Ign http://kali.mirror.garr.it kali/non-free Translation-en
Fetched 16.6 MB inwards 11s (1,388 kB/s)
Reading packet lists... Done
root@kali: #
…no warnings :)
Done!
Rollback changes
If anything goes wrong at whatsoever phase or the server isn’t working, nosotros are able to restore from the backup past times doing:
root@kali: # cp -f /etc/apt/sources.list{.bkup,}
root@kali: # apt-get update
Get:1 http://security.kali.org kali/updates Release.gpg [836 B]
Get:2 http://http.kali.org kali Release.gpg [836 B]
Get:3 http://security.kali.org kali/updates Release [11.0 kB]
Get:4 http://http.kali.org kali Release [21.1 kB]
Get:5 http://security.kali.org kali/updates/main i386 Packages [143 kB]
Get:6 http://http.kali.org kali/main Sources [7,531 kB]
Ign http://security.kali.org kali/updates/contrib Translation-en_GB
Ign http://security.kali.org kali/updates/contrib Translation-en
Ign http://security.kali.org kali/updates/main Translation-en_GB
Ign http://security.kali.org kali/updates/main Translation-en
Ign http://security.kali.org kali/updates/non-free Translation-en_GB
Ign http://security.kali.org kali/updates/non-free Translation-en
Ign http://http.kali.org kali/contrib Translation-en_GB
Ign http://http.kali.org kali/contrib Translation-en
Ign http://http.kali.org kali/main Translation-en_GB
Ign http://http.kali.org kali/main Translation-en
Ign http://http.kali.org kali/non-free Translation-en_GB
Ign http://http.kali.org kali/non-free Translation-en
Get:7 http://http.kali.org kali/non-free Sources [117 kB]
Get:8 http://security.kali.org kali/updates/contrib i386 Packages [20 B]
Get:9 http://http.kali.org kali/contrib Sources [55.5 kB]
Get:10 http://security.kali.org kali/updates/non-free i386 Packages [20 B]
Get:11 http://http.kali.org kali/main i386 Packages [8,450 kB]
Get:12 http://http.kali.org kali/non-free i386 Packages [115 kB]
Get:13 http://http.kali.org kali/contrib i386 Packages [55.2 kB]
Fetched 16.5 MB inwards 18s (870 kB/s)
Reading packet lists... Done
root@kali: #
…and everything is dorsum to normal :)
Related posts:
How to add together official Kali Linux Repositories?
How to cook Kali Linux apt-get tiresome update?
Bookmarks/Handy links specific for Kali Linux:
Official Kali Linux Mirrors
Kali Linux sources.list Repositories
Thanks for reading.