[CentOS] Creating the symbolic links in the /boot and /boot/grub/

Wed Mar 9 05:53:10 UTC 2011
Nico Kadel-Garcia <nkadel at gmail.com>

On Wed, Mar 9, 2011 at 12:40 AM, Todd Cary <todd at aristesoftware.com> wrote:
> My current kernel is "vmlinuz-2.6.9-89.35.1" per grub.conf:
>
> #boot=/dev/hdc
> default=1
> timeout=5
> splashimage=(hd0,0)/grub/splash.xpm.gz
> hiddenmenu
> title CentOS (2.6.9-100.EL)
>    root (hd0,0)
>    kernel /vmlinuz-2.6.9-100.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet
>    initrd /initrd-2.6.9-100.EL.img
> title CentOS (2.6.9-89.35.1.ELsmp)
>    root (hd0,0)
>    kernel /vmlinuz-2.6.9-89.35.1.ELsmp ro root=/dev/VolGroup00/LogVol00 rhgb
> quiet
>    initrd /initrd-2.6.9-89.35.1.ELsmp.img
>
> What is the correct syntax for "rpm -U -replacepkgs [kernel-whatever].rpm" ?
>  What should go into [kernel-whaetver]?
>
> In like manner, I have forgotten how to do a query on it to see if it is
> present as in
>
> # rpm -q [kernel-name]
>
> Sorry, but it has been a long time since I used rpm and my Admin book does
> not give an example.
>
> Todd

OK, this should all go to the list for other CentOS folks who run into
this kind of adventure. To get the full list of RPM's, look at the
syntax of the "/etc/cron.daily/rpm"nightly script.

> man rpm

to look up the available options and learn about them. It's usually
worth learning about such an important command, and RPM components are
what yum really uses, so it's helpful to understand.

> rpm -qa | grep kernel

to get the list of kernel related components. Because of this line in
your grub.conf:

     kernel /vmlinuz-2.6.9-100.EL

I can also deduce that the relevant vmlinuz file was at
/boot/bmlinuz-2.6.9-100.EL, and you can use the command "rpm -q -f
/boot/vmlinuz-2.6.9-100.EL" to figure out what package it belonged to.

> rpm -q -f /boot/vmlinuz-2.6.9-100.EL --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n'

will get you the  get the full package name of the actual kernel RPM.

Download the latest RPM from your favorite CentOS repository, after
all, updating your kernel is you got into this trouble in the first
place.

> rpm -U --replacepkgs [whatever the name of that actual downloaded rpm is]

See, you shouldn't *care* about your actual running kernel. You wanted
the update, right? Go for it!!!! The running kernel will present
problems you want the most recent one.