How to downgrade a kernel?

22,925

Solution 1

rpm -ivh <kernel.rpm> --oldpackage does the job in centos

This will install your kernel, now make sure the grub entries are proper and then you can reboot and boot into this kernal

Solution 2

Actually, downgrade wouldn't work for kernel. The right command would be localinstall:

#yum localinstall ./kernel....rpm

If you have more then 5 kernels yum will delete oldest.

Share:
22,925
JATMON
Author by

JATMON

Updated on September 18, 2022

Comments

  • JATMON
    JATMON over 1 year

    I need to downgrade the kernel from 2.6.32-358.6.2.el6.centos.plus.x86_64 to 2.6.32-220.el6.x86_64

    I am unable to install the older version using Yum/rpm as it gives the following error

    root@localhost kernels]# rpm -i --ignoreos kernel-2.6.32-220.el6.x86_64.rpm 
    warning: kernel-2.6.32-220.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID  
    192a7d7d: NOKEY
    package kernel-2.6.32-279.el6.x86_64 (which is newer than kernel-2.6.32-220.el6.x86_64) is already installed
    package kernel-2.6.32-358.6.1.el6.centos.plus.x86_64 (which is newer than kernel-2.6.32-220.el6.x86_64) is already installed
    package kernel-2.6.32-358.6.2.el6.centos.plus.x86_64 (which is newer than kernel-2.6.32-220.el6.x86_64) is already installed
    

    I cant remove the currently running kernel , so whats the way out?

    Yum search doesnt even get me to this old version, so had to get the rpm from web.

    Any help is much appreciated.

    • LawrenceC
      LawrenceC almost 11 years
      I don't have a lot of experience with rpm but can't you remove the current kernel package and then install the lower version one? The kernel isn't actually in effect until your reboot next. I'm not sure if CentOS/Redhat does this, but in Debian, when you upgrade your kernel with a kernel package, the previous kernel can be selected in the bootloader still. You might be able to do this too.
    • Ignacio Vazquez-Abrams
      Ignacio Vazquez-Abrams almost 11 years
      @ultrasawblade: There's no need to remove the old kernel. Fedora-based distros allow multiple kernel packages to be installed; the trick is to use -i (instead of -U) and --oldpackage.
    • cybernard
      cybernard almost 11 years
      @JATMON Actually what you need to do is get a linux with a modern kernel version. The current version is 3.9.6 your centos version is using an ancient kernel.