Joined: 21 Sep 2003 Posts: 16777097 Location: Portugal
Posted: 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:
Quote:
# 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:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum