4rch-linux/usr/share/ezarcher/Docs/reflector-pacman-hook.txt
2026-04-28 23:32:38 +02:00

25 lines
736 B
Text

Automate mirrorlist generation with Pacman hook:
Create a file /etc/pacman.d/hooks/mirrorupgrade.hook
$ sudo mkdir /etc/pacman.d/hooks
$ sudo nano /etc/pacman.d/hooks/mirrorupgrade.hook
Add the following lines:
[Trigger]
Operation = Upgrade
Type = Package
Target = pacman-mirrorlist
[Action]
Description = Updating pacman-mirrorlist with reflector and removing pacnew...
When = PostTransaction
Depends = reflector
Exec = /bin/sh -c "reflector --latest 10 --sort rate --protocol https --save /etc/pacman.d/mirrorlist; rm -f /etc/pacman.d/mirrorlist.pacnew"
Save and close the file.
reflector-pacman-hook.txt
# Revision: 2022.04.22 -- by eznix (https://sourceforge.net/projects/ezarch/)
# (GNU/General Public License version 3.0)