The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Kernel Upgrade

Discussion in 'General Discussion' started by assassin85, Mar 19, 2008.

  1. assassin85

    assassin85 Active Member

    Joined:
    Jul 24, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    hi,

    i want to know what the correct steps to upgrade kernel with os Centos 4 , Fedora 4

    thanks
     
  2. jandafields

    jandafields Well-Known Member

    Joined:
    May 6, 2004
    Messages:
    426
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Keep in mind that you should have an emergency plan in place, since upgrading your kernel could EASILY break your box.

    The "basic" way:
    yum upgrade kernel

    The "advanced" way:
    compile kernel from sources, customizing it like you want

    Read up on kernel.org and linuxquestions.org.
     
  3. Tam

    Tam Well-Known Member

    Joined:
    Jul 31, 2004
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    16
    If you are not running a customer kernel (if you don't know the answer its probably no), then running yum -y update is good, however if you have experiences like most of us and find that kernel updates panic and wont boot, then you need to put in a failsafe to fall back to the old or previously working kernel to save you having to wait for someone to reboot at the datacentre or via KVM, so ...

    Run ...

    Code:
    yum -y update
    before rebooting, edit grub.conf and add ...

    Code:
    panic=5
    to the end of the kernel version lines, i.e....

    Code:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You do not have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /, eg.
    #          root (hd0,0)
    #          kernel /boot/vmlinuz-version ro root=/dev/sda1
    #          initrd /boot/initrd-version.img
    #boot=/dev/sda
    default=0
    timeout=5
    splashimage=(hd0,0)/boot/grub/splash.xpm.gz
    hiddenmenu
    title CentOS (2.6.18-53.1.4.el5)
    	root (hd0,0)
    	kernel /boot/vmlinuz-2.6.18-53.1.4.el5 ro root=LABEL=/ panic=5
    	initrd /boot/initrd-2.6.18-53.1.4.el5.img
    title CentOS (2.6.18-8.el5)
    	root (hd0,0)
    	kernel /boot/vmlinuz-2.6.18-8.el5 ro root=LABEL=/ panic=5
    	initrd /boot/initrd-2.6.18-8.el5.img
    Then run this command from SSH as root...

    Code:
    echo "savedefault --default=1 --once" | grub --batch
    Then reboot.

    This will force a reboot on the next kernel version in the list if the latest one panics and fails to load. And then you can remove the update that failed to boot...

    Code:
    yum remove kernel-2.6.18-53.1.4.el5
    obviously use the correct version number in the above example.

    And then you will want to exclude that version from subsequent updates when using yum, so add an exclude in your yum.conf [MAIN] section...

    Code:
    exclude=kernel-2.6.18-53.1.4.el5
    again, obviously using the correct version number in the example above.
     
  4. Tam

    Tam Well-Known Member

    Joined:
    Jul 31, 2004
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    16
    I neglected to mention ...

    If you have Fantastico installed and have rolled back the wget version as Fantastico requests, you will need to exclude it in your yum.conf to prevent an error during yum update. So, add an exclude in the [MAIN] section of yum.conf for wget, i.e. ...

    Code:
    exclude=apache* courier* exim* httpd* mod_ssl* mysql* perl* php* proftpd* pure-ftpd* spamassassin* squirrelmail* wget*
    note that in this example the wget exclude is added onto the end of the existing exclude line
     
Loading...

Share This Page