[ Prev ] [ Index ] [ Next ]

Mirrors

Created lørdag 22 oktober 2016


Use European servers

# Edit the /etc/pacman.conf file. Add the following server lines before the include lines.

[core]
Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch
Include = /etc/pacman.d/mirrorlist

[extra]
Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/extra/os/$arch
Include = /etc/pacman.d/mirrorlist

[community]
Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/community/os/$arch
Include = /etc/pacman.d/mirrorlist



Using Reflector

# Reflector is a package that retrieve the latest mirror list, filter the most up-to-date -
# sort them by speed and overwrite the /etc/pacman.d/mirrorlist.
$ pacman -S reflector


# To rate and update the mirrorlist
$ reflector --verbose -l 30 --number 20 -p https --sort rate --save /etc/pacman.d/mirrorlist


Automatic update mirrorlist when a new is installed (.pacnew)

# You can create a pacman hook to run reflector everytime pacman-mirrorlist gets an upgrade.
# Create a new hook /etc/pacman.d/hooks/mirrorupgrade.hook

[Trigger]
Operation = Upgrade
Type = Package
Target = pacman-mirrorlist

[Action]
Description = Updating pacman-mirrorlist with reflector and removing pacnew...
When = PostTransaction
Depends = reflector
Exec = /usr/bin/env sh -c "reflector --verbose -l 30 --number 20 --age 24 --sort rate --save /etc/pacman.d/mirrorlist; if [[ -f /etc/pacman.d/mirrorlist.pacnew ]]; then rm /etc/pacman.d/mirrorlist.pacnew; fi"