Set Up Arch Linux Mirrors
Optimize your mirrors for faster package updates. Choose one of these methods:
INFO
Reflector→ Automatically find and rank mirrors (recommended).Mirrorlist Generator→ Select mirrors manually.Rankmirrors→ Rank mirrors by speed usingpacman-contrib.
1. Using Reflector (Recommended)
reflector automatically updates and ranks mirrors.
Install Reflector
shell
sudo pacman -S reflectorBackup Your Mirrorlist
shell
sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bakUse Reflector to Rank Mirrors
Run this command (replace 'Germany' with your country):
shell
sudo reflector --country 'Germany' --latest 5 --protocol https --sort rate --save /etc/pacman.d/mirrorlistConfig Info:
--country→ Mirrors in your location.--latest 5→ Use latest 5 synced mirrors.--protocol https→ Use HTTPS mirrors.--sort rate→ Rank mirrors by speed.
Verify the Mirrorlist
shell
cat /etc/pacman.d/mirrorlistAutomate Reflector (Optional)
Create a configuration file:
shellsudo nano /etc/xdg/reflector/reflector.confExample:
--country 'United States' --latest 5 --protocol https --sort rate --save /etc/pacman.d/mirrorlistEnable the service:
shellsudo systemctl enable --now reflector.service
Refresh the Database
shell
sudo pacman -Syy2. Using the Arch Linux Mirrorlist Generator
INFO
- Visit the mirrorlist generator.
- Select your country/region and customize options.
- Generate and copy/download the mirrorlist.
Backup and Replace the Mirrorlist
- Backup your current list:shell
sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak - Edit the file and paste the list:shell
sudo nano /etc/pacman.d/mirrorlist - Uncomment all mirrors manually or using:shell
sudo sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist
Refresh the Database
shell
sudo pacman -Syy3. Using Rankmirrors with Pacman-Contrib
rankmirrors ranks mirrors by speed.
Install pacman-contrib
shell
sudo pacman -S pacman-contribBackup Your Mirrorlist
shell
sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bakUncomment All Mirrors
- Edit the file:shell
sudo nano /etc/pacman.d/mirrorlist - Or uncomment automatically:shell
sudo sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist
Rank the Mirrors
Save the top 10 mirrors:
shell
rankmirrors -n 10 /etc/pacman.d/mirrorlist | sudo tee /etc/pacman.d/mirrorlistRefresh the Database
shell
sudo pacman -Syy