reinstall kernel

Networking/Security Forums -> UNIX // GNU/Linux

Author: duster PostPosted: Mon Dec 07, 2009 3:06 pm    Post subject: reinstall kernel
how do i reinstall my centos linux kernel from a boot cd. ive booted into rescue mode now what do i do?

Author: capiLocation: Portugal PostPosted: Mon Dec 07, 2009 4:49 pm    Post subject: Reinstalling the kernel from a GNU/Linux live CD
The easiest way, assuming the boot CD has a minimally compatible kernel (i.e. not too old, and if the installed system is 32-bit, so is the CD, and if the installed system is 64-bit so is the CD), is to chroot into the installed filesystem and run your package manager as normal.

You would just do, as root, something like the following sequence:
# mkdir /mnt/root
# mount /dev/sdaX /mnt/root
# mount -o bind /proc /mnt/root/proc
# mount -o rbind /dev /mnt/root/dev
# chroot /mnt/root /bin/bash

Now you have a prompt inside the installed system. Just run your package manager as normal -- I don't know exactly the name of the kernel package for CentOS, but you should be able to find it by doing something like yum search kernel.

Unfortunately yum is quite limited in its flexibility; it doesn't have a reinstall option like Debian's apt or Gentoo's portage. To force the reinstallation of an existing package, you'll have to remove it then install it again. The problem is that if you try to remove the kernel, yum will probably want to remove a bunch of other packages as well, due to dependency issues. Your safest bet is to remove the kernel by hand, using rpm. Once you know the name of the kernel package:
# rpm --erase --nodeps KERNEL_PACKAGE_NAME

Finally, just exit the chroot and reboot the system:
# exit
# reboot

Networking/Security Forums -> UNIX // GNU/Linux

output generated using printer-friendly topic mod, All times are GMT + 2 Hours

Page 1 of 1

Powered by phpBB 2.0.x © 2001 phpBB Group