Create your own Custom Mirrorlist

From Manjaro Linux
Jump to: navigation, search

Why a Custom mirrorlist?

This article covers the latest version of pacman-mirrors which is version 4.2. A more in-depth article on Pacman-mirrors

Manjaro now has a lot of Mirrors, which is terrific. A negative side effect of having all these mirrors is that ranking them all takes longer for most people than it did when there were fewer mirrors.

People who want to create a custom mirrorlist containing only those servers which have shown themselves to be consistently faster for them, can now do so.

pacman-mirrors will only rank the servers that you put in your Custom list. So you may want to check from time to time if any new mirrors have been added, which may be faster & worth adding to your Custom list.


How do you do it?

  • In a terminal run the pacman-mirrors app with superuser rights. The [] are options which are not required but can improve on the resulting selection window.
sudo pacman-mirrors --interactive [-m random] [--default] [{[-c {all|COUNTRY COUNTRY COUNTRY}]|[--geoip]}]
  • Select your desired mirrors
  • Click OK twice

ALWAYS Sync/refresh package lists - the first y tells pacman to sync package database and the second y tell pacman to do it even if the databases seems up-to-date

sudo pacman -Syy


Examples:

sudo pacman-mirrors -i -c Germany,United_Kingdom -m random && sudo pacman -Syy
sudo pacman-mirrors --geoip && sudo pacman -Syy 

You will most certainly come to a point where you wish to reset your list

sudo pacman-mirrors -c all -i -m random && sudo pacman -Syy
sudo pacman-mirrors -i --default && sudo pacman -Syy


Example Files

/var/lib/pacman-mirrors/custom-mirrors.json

This is a custom mirror file using only Germany and United_Kingdom:

[
    {
        "country": "United_Kingdom",
        "protocols": [
            "http"
        ],
        "url": "http://manjaro.mirrors.uk2.net/"
    },
    {
        "country": "United_Kingdom",
        "protocols": [
            "http"
        ],
        "url": "http://mirror.catn.com/pub/manjaro/"
    },
    {
        "country": "Germany",
        "protocols": [
            "http"
        ],
        "url": "http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/"
    },
    {
        "country": "Germany",
        "protocols": [
            "https"
        ],
        "url": "https://mirror.netcologne.de/manjaro/"
    },
    {
        "country": "Germany",
        "protocols": [
            "http"
        ],
        "url": "http://ftp.tu-chemnitz.de/pub/linux/manjaro/"
    },
    {
        "country": "United_Kingdom",
        "protocols": [
            "https"
        ],
        "url": "https://www.mirrorservice.org/sites/repo.manjaro.org/repos/"
    },
    {
        "country": "Germany",
        "protocols": [
            "https"
        ],
        "url": "https://repo.rhindon.net/manjaro/"
    },
    {
        "country": "Germany",
        "protocols": [
            "https",
            "http"
        ],
        "url": "https://ftp.halifax.rwth-aachen.de/manjaro/"
    },
    {
        "country": "Germany",
        "protocols": [
            "https",
            "http"
        ],
        "url": "https://manjaro-mirror-a.alpix.eu/"
    },
    {
        "country": "Germany",
        "protocols": [
            "https",
            "http"
        ],
        "url": "https://repo.stdout.net/manjaro/"
    },
    {
        "country": "Germany",
        "protocols": [
            "https"
        ],
        "url": "https://mirror.netzspielplatz.de/manjaro/packages/"
    },
    {
        "country": "Germany",
        "protocols": [
            "http"
        ],
        "url": "http://mirror.ragenetwork.de/manjaro/"
    },
    {
        "country": "United_Kingdom",
        "protocols": [
            "http"
        ],
        "url": "http://repo.manjaro.org.uk/"
    }
]


/etc/pacman-mirrors.conf

##
#/etc/pacman-mirrors.conf
##

#Branch Pacman should use (stable, testing, unstable)
Branch = unstable

#Generation method
#1) rank   - rank mirrors depending on their access time
#2) random - randomly generate the output mirrorlist
Method = rank

#Define protocols and priority
#  separated by comma 'https,http' or 'http,https'
#ATM available protocols are: http, https, ftp
#Not specifying a protocol will ban the protocol from being used
#If a mirror has more than one protocol defined only the first is written to the mirrorlist
#Empty means all in reversed alphabetic order
Protocols =

#Specify to use only mirrors from a specific country.
#Can add multiple countries
#  separated by comma 'Germany,France,Belgium'
#Get a list of all available counties with 'pacman-mirrors -l'
#Empty means all
OnlyCountry = Germany,United_Kingdom

#When set to False - all certificates are accepted.
#Use only if you fully trust all ssl-enabled mirrors.
SSLVerify = True


The output of sudo pacman-mirrors -c Germany,United_Kindom

~ >>> sudo pacman-mirrors -c Germany United_Kingdom && sudo pacman -Syy                          
[sudo] password for nn : 
.: Info Downloading mirrors from repo.manjaro.org
.: Info Using custom mirror file
.: Info Querying mirrors - This may take some time
   0.107 Germany        : http://mirror.ragenetwork.de/manjaro/
   1.397 Germany        : https://ftp.halifax.rwth-aachen.de/manjaro/
   0.551 Germany        : ftp://ftp.halifax.rwth-aachen.de/manjaro/
   0.223 Germany        : http://ftp.tu-chemnitz.de/pub/linux/manjaro/
   0.312 Germany        : ftp://ftp.tu-chemnitz.de/pub/linux/manjaro/
   0.154 Germany        : https://mirror.netzspielplatz.de/manjaro/packages/
   0.131 Germany        : https://mirror.netcologne.de/manjaro/
   0.110 Germany        : https://repo.rhindon.net/manjaro/
   0.173 Germany        : https://repo.stdout.net/manjaro/
   0.140 Germany        : https://mirror.alpix.eu/manjaro/
   0.155 Germany        : https://manjaro-mirror-a.alpix.eu/
   0.063 Germany        : http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/
   0.389 Germany        : ftp://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/
   0.099 Germany        : http://babyname.tips/mirrors/manjaro/
   0.265 United_Kingdom : http://repo.manjaro.org.uk/
   0.163 United_Kingdom : https://www.mirrorservice.org/sites/repo.manjaro.org/r
   0.069 United_Kingdom : http://mirror.catn.com/pub/manjaro/
   0.058 United_Kingdom : http://manjaro.mirrors.uk2.net/
.: Info Writing mirror list
   United_Kingdom  : http://manjaro.mirrors.uk2.net/unstable
   United_Kingdom  : http://mirror.catn.com/pub/manjaro/unstable
   Germany         : http://babyname.tips/mirrors/manjaro/unstable
   Germany         : http://mirror.ragenetwork.de/manjaro/unstable
   Germany         : https://repo.rhindon.net/manjaro/unstable
   Germany         : https://mirror.netcologne.de/manjaro/unstable
   Germany         : https://mirror.alpix.eu/manjaro/unstable
   Germany         : https://mirror.netzspielplatz.de/manjaro/packages/unstable
   Germany         : https://manjaro-mirror-a.alpix.eu/unstable
   United_Kingdom  : https://www.mirrorservice.org/sites/repo.manjaro.org/repos/
   Germany         : https://repo.stdout.net/manjaro/unstable
   United_Kingdom  : http://repo.manjaro.org.uk/unstable
   Germany         : http://ftp.tu-chemnitz.de/pub/linux/manjaro/unstable
   Germany         : http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/unstabl
   Germany         : https://ftp.halifax.rwth-aachen.de/manjaro/unstable
.: Info Mirror list generated and saved to: /etc/pacman.d/mirrorlist
:: Synchronizing package databases...
 core                     141,3 KiB  1055K/s 00:00 [######################] 100%
 extra                   1820,4 KiB  3,05M/s 00:01 [######################] 100%
 community                  4,3 MiB  8,09M/s 00:01 [######################] 100%
 multilib                 178,7 KiB  0,00B/s 00:00 [######################] 100%


The resulting /etc/pacman.d/mirrorlist

##
## Manjaro Linux mirrorlist
## Generated on 2017-09-09 10:25
##
## Use pacman-mirrors to modify
##

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

## Country : United_Kingdom
Server = http://mirror.catn.com/pub/manjaro/unstable/$repo/$arch

## Country : Germany
Server = http://babyname.tips/mirrors/manjaro/unstable/$repo/$arch

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

## Country : Germany
Server = https://repo.rhindon.net/manjaro/unstable/$repo/$arch

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

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

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

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

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

## Country : Germany
Server = https://repo.stdout.net/manjaro/unstable/$repo/$arch

## Country : United_Kingdom
Server = http://repo.manjaro.org.uk/unstable/$repo/$arch

## Country : Germany
Server = http://ftp.tu-chemnitz.de/pub/linux/manjaro/unstable/$repo/$arch

## Country : Germany
Server = http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/unstable/$repo/$arch

## Country : Germany
Server = https://ftp.halifax.rwth-aachen.de/manjaro/unstable/$repo/$arch


Support

Following is a link to this page's forum counterpart where you can post any related feedback: Pacman-Mirrors