Skip to content

Instantly share code, notes, and snippets.

@luluco250
Created March 2, 2022 23:30
Show Gist options
  • Save luluco250/e9f8a184a099ad6d4fdb984e82f91d09 to your computer and use it in GitHub Desktop.
Save luluco250/e9f8a184a099ad6d4fdb984e82f91d09 to your computer and use it in GitHub Desktop.
Script to update pacman mirrors using reflector
#!/bin/bash
[[ $(id -u) > 0 ]] && echo 'Error: Needs to be run as root.' && exit 1
reflector \
--country 'Brazil,Canada,Chile,Colombia,Ecuador,Mexico,Paraguay,United States' \
--fastest 10 \
--protocol https \
--sort rate \
--threads $(nproc) \
--save /etc/pacman.d/mirrorlist && \
pacman -Syyu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment