Skip to content

Instantly share code, notes, and snippets.

@dw72
Last active August 26, 2016 15:13
Show Gist options
  • Save dw72/a56ad48626499f9a24f18bdbbdf6efc7 to your computer and use it in GitHub Desktop.
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
[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