Pacman hook using pacman command
I made an "autoremove" hook that removes packages no more necessary, but since it is executed when pacman is in use:
(1/3) autoremove.hook
error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
if you're sure a package manager is not already
running, you can remove /var/lib/pacman/db.lck
error: command failed to execute correctly
I saw the command on some wiki:
pacman -Qtdq | pacman -Rns -
I think that would be nice to have an option in the pacman config to do this automatically.