You are not logged in.
Pages: 1
Suppose I create a pacman hook to automate a task and save it in /etc/pacman.d/hooks directory. If at some point in the future, I don't want that task to execute automatically using that pacman hook, can I just delete that .hook file to prevent that task from being executed automatically next time?
I did read about “Overriding the Hook” https://archlinux.org/pacman/alpm-hooks … ding_hooks......
I understood the working, but I just want to know if simply deleting the .hook file would work or not!
#JUSTCURIOUS!
Last edited by Rayshabh (2022-04-18 07:01:35)
Offline
Yes. If you delete the hook file it will not be run any more.
Another way to disable a hook can be just to rename the file, eg. from something.hook to something.inactive
Offline
Yes. If you delete the hook file it will not be run any more.
Another way to disable a hook can be just to rename the file, eg. from something.hook to something.inactive
Yeah, renaming the file feels a lot simpler and quicker approach than overriding the file. Also, I don't have to delete the hook file (in case if I need it back again).
Thank you for your suggestion! ![]()
Offline
Uhm.. don't know if you misunderstood me - I ment renaming hook files you have placed in /etc/pacman.d/hooks, either to add your own hooks or to override hooks in /usr/share/libalpm/hooks.
It's not a good idea to rename or delete hooks in /usr/share/libalpm/hooks as these are added by installed packages and will be overwritten or recreated when the packages are updated.
If you want to disable or override a hook in /usr/share/libalpm/hooks, you create a hook file with the same name in /etc/pacman.d/hooks.
A similarly named file in /etc/pacman.d/hooks will be run instead of the hook file in /usr/share/libalpm/hooks.
If you want to plain disable the hook file in /usr/share/libalpm/hooks, the right way to do that will be to let the file in /etc/pacman.d/hooks be a symbolic link to /dev/null.
Check out the description in the wiki: https://wiki.archlinux.org/title/Pacman#Hooks
Last edited by Ferdinand (2022-04-18 07:04:34)
Offline
Uhm.. don't know if you misunderstood me - I ment renaming hook files you have placed in /etc/pacman.d/hooks, either to add your own hooks or to override hooks in /usr/share/libalpm/hooks.
It's not a good idea to rename or delete hooks in /usr/share/libalpm/hooks as these are added by installed packages and will be overwritten or recreated when the packages are updated.
If you want to disable or override a hook in /usr/share/libalpm/hooks, you create a hook file with the same name in /etc/pacman.d/hooks.
A similarly named file in /etc/pacman.d/hooks will be run instead of the hook file in /usr/share/libalpm/hooks.
If you want to plain disable the hook file in /usr/share/libalpm/hooks, the right way to do that will be to let the file in /etc/pacman.d/hooks be a symbolic link to /dev/null.Check out the description in the wiki: https://wiki.archlinux.org/title/Pacman#Hooks
Understood! Thanks a ton! ![]()
Offline
Pages: 1