LinuxCommandLibrary

pacman-mirrors

Manage pacman mirrorlist for faster downloads

TLDR

Generate a mirrorlist using the default settings

$ sudo pacman-mirrors --fasttrack
copy

Get the status of the current mirrors
$ pacman-mirrors --status
copy

Display the current branch
$ pacman-mirrors --get-branch
copy

Switch to a different branch
$ sudo pacman-mirrors --api --set-branch [stable|unstable|testing]
copy

Generate a mirrorlist, only using mirrors in your country
$ sudo pacman-mirrors --geoip
copy

SYNOPSIS

pacman-mirrors [options]

PARAMETERS

-h, --help
    Show help message and exit.

-v, --version
    Show version number and exit.

-g, --generate
    Generate a mirrorlist based on current configuration.

-f [NUMBER], --fasttrack [NUMBER]
    Select the NUMBER fastest mirrors.

-i, --interactive
    Interactively choose mirrors from a list.

-c [COUNTRY], --country [COUNTRY]
    Limit mirrors to the specified COUNTRY (comma separated).

-m [METHOD], --method [METHOD]
    Sorting method: age, rate, score.

--api
    Use the mirrorlist API for mirror selection.

--no-status
    Disable mirror status check before generation.

--geoip
    Filter mirrors based on GeoIP location.

--url [URL]
    Use the specified URL as mirror pool.

-l, --list
    List current mirrors in use.

--status
    Show the status of the mirrors.

--set-branch [BRANCH]
    Set the branch (stable, testing, unstable).

--get-branch
    Get the current branch.

--set-mirror-status
    Set mirror status check on mirrorlist.

--reset
    Reset the configuration to default.

--config [CONFIG_FILE]
    Use custom configuration file. Default: /etc/pacman.d/mirrorlist

DESCRIPTION

pacman-mirrors is a command-line tool for managing the mirror list used by pacman, the Arch Linux package manager. It automatically generates a ranked mirror list based on connection speed and other criteria to improve download performance. It dynamically adjusts the mirror list to use the fastest and most reliable mirrors available, ensuring efficient package updates and installations. The tool can sort mirrors by various parameters like latency and score. It can target mirrors in specific countries or continents. pacman-mirrors provides options to backup the current configuration before changes are applied.
Note: Regularly updating the mirror list is crucial for maintaining a healthy and responsive Arch Linux system. Incorrect or outdated mirror lists can lead to slow download speeds, package update failures, and even broken installations.

CAVEATS

Running pacman-mirrors without appropriate options may result in a poorly optimized mirror list. It's important to understand the available options and choose them according to network conditions and desired performance. Always update pacman's database after changing the mirrorlist using pacman -Syy.

CONFIGURATION FILE

pacman-mirrors's main configuration file is located at /etc/pacman.d/mirrorlist. This file defines the mirrors to be used by pacman. You can manually edit this file, but it's generally recommended to use pacman-mirrors commands to manage the list.

MIRROR RANKING

pacman-mirrors ranks mirrors based on criteria such as latency and download speed. The tool pings each mirror and measures the response time, sorting them from fastest to slowest. This ensures that pacman uses the quickest mirrors for package downloads.

HISTORY

The pacman-mirrors command was created to simplify the process of managing pacman's mirrorlist in Arch Linux.
Over time, it evolved to incorporate automated mirror selection based on various factors, providing users with a more streamlined and efficient package management experience.

SEE ALSO

pacman(8), reflector(1)

Copied to clipboard