Tutorials | Challenges | Tools | Downloads | Resources | Documentaries

Optimizing Arch Linux Mirrors List & Speeding Up Downloads




Installing a new Linux OS or even just downloading software, can be a time-consuming lengthy process. As your Linux OS uses a list containing mirrors as a means of downloading, it can sometimes use mirrors on that list which are quite slow.

However, we can optimize the Mirror List so our Arch install, and ALL other downloads, only come via the quickest mirrors on the list.


To do this optimization, we will do the following:

1) Make a backup of our current mirrors list
2) Ping all the mirrors in that list to test the speed
3)Create a new list of mirrors that includes only the top 6 fastest mirrors

This can be done before you do the main install of Arch Linux, or after, so you have a quick download speed for installing software.

Let's make a backup of the current mirror list that have.

Quote:cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup

Some of the mirrors on the list may be "commented out" which means that the name of the mirror follows a #

As we want to test all the mirrors, we need to "uncomment those mirrors, so that they are included in our speed test.

However, that will take ages to do them one-by-one. So we can use the following command, and Arch will do this for us.

sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup
Now we need to test the speed of all those mirrors. The following command will test the speed of all the mirrors, then make the top 6 mirrors uncommented and comment out the rest, so they are not used.



rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist

When you next download something, Arch will download only from those top 6 fastest mirrors.
Labels:
Reactions:

Post a Comment

[blogger]

GrayHatHackers

{twitter https://twitter.com/ghhackers}

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget