Skip to content

Instantly share code, notes, and snippets.

@dw72
Last active May 17, 2025 15:37
Show Gist options
  • Select an option

  • Save dw72/a56ad48626499f9a24f18bdbbdf6efc7 to your computer and use it in GitHub Desktop.

Select an option

Save dw72/a56ad48626499f9a24f18bdbbdf6efc7 to your computer and use it in GitHub Desktop.
Hook to update pacman mirrorlist using reflector after each upgrade of pacman-mirrorlist #arch #linux
[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/bash -c "reflector --country 'Poland' --latest 5 --sort rate --save /etc/pacman.d/mirrorlist && rm -f /etc/pacman.d/mirrorlist.pacnew || true"
@dw72
Copy link
Author

dw72 commented Aug 26, 2016

Place this file in /etc/pacman.d/hooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment