Listing package hooks

Hey there,

I was just wondering how I can check what pacman hooks will be ran when I install or uninstall a package. Yesterday I got completely rid of snap-pac-grub, which also uninstalled snap-pac along with it, resulting in it deleting my snapper root configuration and all my snapshots of that partition.

While I luckily didn't suffer from any data loss, I'm still annoyed, since I only found out about these hooks when they started executing.

Is there a way to see what will be ran?


I believe you can determine that by reading the last part of the PKGBUILD:

package() {
    install -Dm755 -t "$pkgdir/usr/share/libalpm/scripts" grub-mkconfig
    install -Dm644 -t "$pkgdir/usr/share/libalpm/hooks" zz-snap-pac-grub-post.hook
    install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE

Can that be automated somehow? I mean yes, I can run pacman -Ql <package>, but if it removes more packages at once, this approach gets really tedious really quick.

Is there a dry-run mode that shows what packages would be removed by pacman -Rns <package>? I might need to automate that, but it should work without requiring sudo every time

Edit: Just noticed the Required by section in pacman -Qi - Gonna try to automate that

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.