In Ubuntu (and I guess in Debian too) there is a system script named update-grub
which automatically executes grub-mkconfig -o
with the correct path for the grub configuration file.
Is there any similar command for Red Hat based distributions?
If not, how do the system knows where is the grub configuration file to update when a new kernel version is installed?
Best Answer
Specific actions that need to happen when a RPM package is installed or removed are included within the RPM package itself in pre-install, post-install, pre-uninstall and post-uninstall sections.
For every installed RPM package you can query the RPM database for the exact scripts that are included with the
rpm
command:Running that command on a kernel package for CentOS 6 returns among others:
From the manual: