[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Run script after package install, update?





On Sat, Jun 14, 2025, 9:15 PM Boyan Penkov <boyan.penkov@gmail.com> 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.

Thanks kindly, and cheers!

--
Boyan Penkov


Reply to: