On Sun, Jun 15, 2025 at 7:45 AM Nicholas Geovanis <[email protected]> wrote: > > > > On Sat, Jun 14, 2025, 9:15 PM Boyan Penkov <[email protected]> wrote: >> >> Hello folks, >> >> I'm wiring to ask how to get apt to run a script after a particular >> package is installed or updated. Am I looking for dpkg-triggers or >> some apt conf? >> >> Specifically, I have GRUB installed to *every* drive, with the >> expectation that all but one drives can fail and the machine will >> still boot (to something...). To this end, after I see apt has >> updated grub, I manually run something like: >> ``` >> sudo update-grub >> sudo grub-install /dev/sda >> sudo grub-install /dev/sdb >> sudo update-grub >> ``` >> I'd like to automate this; if grub is changed, run this script automatically. > > > You could easily do this with ansible. In perhaps 30 lines of YAML you could > install those fixes, and do the grub work in the same ansible source file. > Repeatable the next time you have fixes to install, just run that playbook > again with 1 command.
First of all, 30 lines to automate 2-4 lines is absurd. You have a hammer, don't recommend it to people who need a screwdriver! Second, this still doesn't run it automatically, which is the only thing OP doesn't know how to do.

