Installing reflector and setting up a systemd timer to update it weekly
pacman -Sy reflectorcat >> /etc/systemd/system/reflector.service << EOF
[Unit]
Description=Run reflector to update pacman mirrorlist
After=network.target network-online.target nss-lookup.target
Wants=network-online.target nss-lookup.target
[Service]
Type=simple
ExecStart=/usr/bin/env sh -c "reflector --latest 50 --age 12 --fastest 20 --sort rate --threads 10 --country SE,NL,DE,NO,PL,GB,DK --protocol https --save /etc/pacman.d/mirrorlist; if [[ -f /etc/pacman.d/mirrorlist.pacnew ]]; then rm /etc/pacman.d/mirrorlist.pacnew; fi"
EOFcat >> /etc/systemd/system/reflector.timer << EOF
[Unit]
Description=Timer for running reflector and updating pacman mirrorlist
[Timer]
OnCalendar=weekly
RandomizedDelaySec=5m
Persistent=true
[Install]
WantedBy=timers.target
EOFsystemctl daemon-reloadsystemctl enable --now reflector.timerLast modified: Tue Feb 10 16:26:34 2026