Rankmirrors to Set the Fastest Download Server

From Manjaro Linux
Jump to: navigation, search


Pacman-mirrors complete reference

On the page Pacman-mirrors you will find a complete reference and detailed examples of its possible use.

Mirror service

On the webpage http://repo.manjaro.org you can see the status of every mirror serving Manjaro packages.

The official Manjaro repositories (also known as mirrors) are hosted on Software Servers. Physically located throughout the world, these servers are responsible for receiving requests for software packages via the terminal and/or pacman-gui, and consequently delivering them to your system. There are therefore three primary factors that will determine how fast your downloads are:

  • Your internet connection
  • The speed of the server itself, and
  • The proximity of the server to you (i.e. how close or how far away it is)

Barring upgrading your internet package or switching providers, it is therefore potentially possible to improve the speed of downloads from the Manjaro repositories by using the pacman-mirrors -g command. This will automatically probe all of the mirror servers available and consequently update the /etc/pacman.d/mirrorlist file, placing them in order from fastest to slowest.

The Mirrorlist file is itself used by Manjaro's package manager pacman to tell it the internet addresses of the Manjaro servers in order to download updates and software applications from them. Alternatively, it is possible to manually determine which server(s) to use, by using the Change to a Different Download Server guide.

The recommended way

To run the pacman-mirrors app, you will need root privileges to do so, otherwise permission will be denied. Also remember to syncronize your database with pacman -Syy.

Using pacman-mirrors -g

The --fasttrack argument should be favoured over --generate This is because pacman-mirrors -g will take a long time and you will get servers which is not syncronized with the latest updates.

Using pacman-mirrors -f{number}

The recommened and preferred way of getting servers for your mirror list is to use the -f{number} argument. This ensures you connect to a server with the lastest software. The {number} is the number of servers you want written to your mirror list. It is highly recommended to run pacman -Syy to ensure syncronization of your pacman databases.

sudo pacman-mirrors -f10 && sudo pacman -Syy

From the above example pacman-mirrors will download a status file from the mirrorservice url. From that file you will get 10 random mirrors which has updated software for your current branch. The 10 mirrors will be sorted by their current accesstimes and written to the mirrorlist.

Once this process is complete, it will then be necessary to synchronize with the newly enabled server(s).

Using pacman-mirrors -i

It works like pacman-mirrors -g, except it now works interactive mode. You are be able to choose your preferred mirrors.

Be aware that the result not only is a custom mirrorlist but also a custom mirror file and if present it will always be used when running pacman-mirrors.

Reset custom mirror file and list

To reset a custom mirror file you have 2 options:

sudo pacman-mirrors --country all && sudo pacman -Syy


sudo pacman-mirrors --interactive --default && sudo pacman -Syy

Then you are be able to renew the list!

Synchronizing your database

Your Manjaro system has a database of all the software packages that are available from the official repositories. These repositories are used by pacman to locate and download packages from them for installation. Synchronizing your database after amending the mirrorlist is the final step in this process. Synchronizing will ensure that your system's database is up to date as well as help to avoid any potential problems when downloading software packages going forward.

Remember to synchronize your database with the new mirror list. To do so enter the following command in the terminal:

sudo pacman -Syy

Once the /etc/pacman.d/mirrorlist has been reordered and the database synchronized, the desired changes will be in effect (there is no need to reboot your system).

Optional: Inspect the contents of the revised mirrorlist

The syntax of the command to open the mirrorlist file is:

sudo [text editor] /etc/pacman.d/mirrorlist

For example, if you wish to view the mirrorlist file within the terminal using nano (a standard terminal-based text editor) then enter:

sudo nano /etc/pacman.d/mirrorlist

Otherwise - if you have installed the full version of Manjaro (i.e. not the NET-Edition) - you may find it easier to use the pre-installed gedit text editor instead. This will open the mirrorlist file up as a document, making it easier to read and edit. To use gedit instead, the command is:

sudo gedit /etc/pacman.d/mirrorlist

Once the contents of the mirrorlist have been viewed, close the file by:

  • nano: Press CTRL and 'x' to exit, or
  • gedit: Close the window.

See Also