Change to a Different Download Server

Revision as of 07:57, 16 October 2018 by imported>Fhdk (→‎Edit the Mirrorlist: Added dependency of gvfs for the admin protocol to work with gui editor)

Overview

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, that is, how close or how far away it is.

Other than upgrading your internet package or switching providers, it is therefore, potentially possible to improve the speed of downloads from the Manjaro repositories by selecting a different server to use.

To get a list of countries currently serving mirrors use the command

sudo pacman-mirrors --country-list

Two methods to switch servers are available. The first is to manually determine the server to use, as is provided in this guide. The second is to use the Rankmirrors command to automatically determine and set the fastest possible server on your behalf, provided in the Use Rankmirrors to Set the Fastest Download Server guide.


Note
The closest server may not always necessarily be the fastest!

Step 1: Changing Servers

This is undertaken by amending the mirrorlist file, which is read by Manjaro's package manager, pacman, for the internet addresses of the Manjaro servers to download updates and software applications from.


Edit the Mirrorlist

If you prefer editing your mirror list by hand - here is how


Tip
More than one server can be enabled. However, they will be selected in the order they are listed, and pacman will only select another server if there is a problem with the one before it.

Due to the versatility of GNU you have a multitude of options for editing text file. Every system and every user has a preferred GUI text editor. However due to security concerns, it is difficult to launch a GUI editor to correctly edit a protected system configuration file.

Therefore you need to be familiar with basic terminal usage. nano is a terminal based text editor available with all Manjaro editions.

Terminal

You will need to first open your terminal in order to edit the mirrorlist file. The syntax of the command to edit the mirrorlist is:

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

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

sudo nano /etc/pacman.d/mirrorlist

GUI loophole

However, a loophole exist for editing system files with a GUI editor. That requires you to know the binary name for the editor. For example does Gnome based editions often include the gedit text editor. If you are unsure - just type gedit in a terminal. Depending on availability it will open or the terminal displays an error message.

To use gedit (if available), the command is:

gedit admin:/etc/pacman.d/mirrorlist

If above command fails, the gvfs package is not installed. This package can be installed with

sudo pacman -Syu gvfs

or with pamac

pamac install gvfs

A list of common GUI editors (a lot more exist)

  • gedit
  • xed
  • pluma
  • mousepad
  • leafpad
  • l3afpad
  • kate
  • geany
  • juffed

Edit the Mirrorlist

Lines beginning with a hash '#' will be ignored by pacman. Hence to disable a mirror, a comment can be put in the beginning of a line starting with Server.

The mirrorlist can be long generally and only a part of it is displayed below:

~ >>> cat /etc/pacman.d/mirrorlist                                                          
##
## Manjaro Linux default mirrorlist
## Generated on 2018-02-17 13:32
##
## Please use 'pacman-mirrors -f [NUMBER]' to modify mirrorlist
##

## Country : Germany
Server = https://mirror.philpot.de/manjaro/unstable/$repo/$arch

## Country : Denmark
Server = https://www.uex.dk/public/manjaro/unstable/$repo/$arch

## Country : United_Kingdom
Server = http://manjaro.mirrors.uk2.net/unstable/$repo/$arch

## Country : Poland
Server = https://mirror.tuchola-dc.pl/manjaro/unstable/$repo/$arch

## Country : Germany
Server = http://mirror.ragenetwork.de/manjaro/unstable/$repo/$arch

## Country : Netherlands
Server = https://mirror.koddos.net/manjaro/unstable/$repo/$arch

## Country : Netherlands
Server = https://manjaro.mirror.wearetriple.com/unstable/$repo/$arch

## Country : Germany
Server = https://mirror.alpix.eu/manjaro/unstable/$repo/$arch

## Country : Netherlands
Server = https://mirror.neostrada.nl/manjaro/unstable/$repo/$arch

## Country : United_Kingdom
Server = https://www.mirrorservice.org/sites/repo.manjaro.org/repos/unstable/$repo/$arch

#----->snipped
Warning
Do not remove hashes from the lines that contain the names of the server countries.


Once you have disabled and/or enabled the desired server(s), save the changes and close the mirrorlist as follows:

  • nano: Press CTRL and 'x' to exit, 'y' to save, and <enter> to finish, or
  • gedit: Select the 'save' option and then close the window.


Now, all that is required is to Synchronise the newly enabled server(s):

sudo pacman -Syyu

Step 2: Synchronising with the Newly Enabled Server(s)

Your Manjaro system has a database of all the software packages that are available from the official repositories. These are used by pacman to locate and download them for installation. Synchronising your database after changing servers will therefore ensure that it is up to date, and avoid any potential problems when subsequently downloading software packages.

To synchronise your database with the Manjaro repositories, enter the following command in the terminal:

sudo pacman -Syyu


Once the Mirrorlist has been amended and the database synchronised, the change will be immediate. There will be no need to reboot your system for the change to take effect.

See Also