[SOLVED] Centos 6.9 always chooses the oldest kernel + kernel downgrade

Issues related to applications and software problems
aegersz
Posts: 66
Joined: 2016/04/04 07:42:58

[SOLVED] Centos 6.9 always chooses the oldest kernel + kernel downgrade

Postby aegersz » 2017/09/24 07:45:51

but no matter what i do with grub.conf, it reverts back to: Linux xxx 2.6.32-431.1.2.0.1.el6.x86_64 #1 SMP Fri Dec 13 13:06:13 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux.

[

Code: Select all

root@forum ~]# rpm -qa | grep kernel | sort
kernel-2.6.32-431.1.2.0.1.el6.x86_64
kernel-2.6.32-696.10.2.el6.centos.plus.x86_64
kernel-2.6.32-696.10.2.el6.x86_64
kernel-debuginfo-2.6.32-696.10.2.el6.centos.plus.x86_64
kernel-debuginfo-common-x86_64-2.6.32-696.10.2.el6.centos.plus.x86_64
kernel-devel-2.6.32-431.1.2.0.1.el6.x86_64
kernel-devel-2.6.32-573.1.1.el6.x86_64
kernel-devel-2.6.32-696.10.2.el6.x86_64
kernel-devel-2.6.32-696.3.1.el6.x86_64
kernel-firmware-2.6.32-696.10.2.el6.centos.plus.noarch
kernel-headers-2.6.32-696.10.2.el6.x86_64
dracut-kernel-004-409.el6_8.2.noarch
php-symfony-http-kernel-2.3.42-1.el6.noarch


i also discovered this: rpm -q --scripts kernel > /root/kernel-script

but how do i use it ?

I am reluctant to remove 431 incase it stops me from rebooting as I have no access to the console - a VPS, it be.
Last edited by aegersz on 2017/09/25 11:49:39, edited 2 times in total.

User avatar
TrevorH
Forum Moderator
Posts: 20605
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Centos 6.9 always chooses the oldest kernel no matter what

Postby TrevorH » 2017/09/24 09:52:42

Which grub.conf are you editing?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

aegersz
Posts: 66
Joined: 2016/04/04 07:42:58

Re: Centos 6.9 always chooses the oldest kernel no matter what

Postby aegersz » 2017/09/24 10:21:59

this one:

Code: Select all

default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-696.10.2.el6.centos.plus.x86_64)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.32-696.10.2.el6.centos.plus.x86_64 ro root=LABEL=DOROOT rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-$
        initrd /boot/initramfs-2.6.32-696.10.2.el6.centos.plus.x86_64.img


it simply ignores it and loads 2.6.32-431.1.2.0.1.el6.x86_64 -- it was likley to have been badly handled at some point and now i'm living with this stupid anomaly.

shall i just start yum removing old kernels ? that's a last resort because i want to figure this one out. thanks for helping.

uname -a:

Linux my-website-org 2.6.32-431.1.2.0.1.el6.x86_64 #1 SMP Fri Dec 13 13:06:13 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

the uname -a response is also messed up too - all those x86_64's (?)

this is what happens when i try to remove that kernel:

Code: Select all

[root@forum ~]# yum remove kernel-2.6.32-431.1.2.0.1.el6.x86_64
Loaded plugins: auto-update-debuginfo, fastestmirror, priorities, security
Setting up Remove Process
Skipping the running kernel: kernel-2.6.32-431.1.2.0.1.el6.x86_64
Loading mirror speeds from cached hostfile
 * base: mirror.0x.sg
 * epel: mirror.vinahost.vn
 * epel-debuginfo: repo.ugm.ac.id
 * extras: mirror.0x.sg
 * remi: mirrors.thzhost.com
 * remi-php56: mirrors.thzhost.com
 * remi-safe: mirrors.thzhost.com
 * rpmforge: mirror.smartmedia.net.id
 * updates: mirror.0x.sg
4040 packages excluded due to repository priority protections
No Packages marked for removal


Do not remove the kernel the system is currently running !!, they tell me.

is package-cleanup --oldkernels --count=2 an option ?
Last edited by aegersz on 2017/09/24 10:42:16, edited 2 times in total.

User avatar
TrevorH
Forum Moderator
Posts: 20605
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Centos 6.9 always chooses the oldest kernel no matter what

Postby TrevorH » 2017/09/24 10:34:36

That doesn't tell me which one - that just shows me what it looks like. What is the path of the file you are editing?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

aegersz
Posts: 66
Joined: 2016/04/04 07:42:58

Re: Centos 6.9 always chooses the oldest kernel no matter what

Postby aegersz » 2017/09/24 10:43:33

the grub file ? that is /boot/grub/grub.conf

i know that CentOS has some continuity from kernel to kernel and that is what my problem is, I THINK ...

User avatar
TrevorH
Forum Moderator
Posts: 20605
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Centos 6.9 always chooses the oldest kernel no matter what

Postby TrevorH » 2017/09/24 11:39:18

So the reason I asked is because there is a file /etc/grub.conf that should be a symlink to the file you are editing. Use of some tools like sed can break that symlink and cause /etc/grub.conf to become a file in its own right and lose the symlink to the correct file. You can then edit the one in /etc and save it but it makes no difference to what grub does as it doesn't read the one in /etc, it only looks at the one in /boot/grub.

Since you're editing the correct file that really only leaves one possibility: you're on a VPs and your kernel is not controlled by you, it's controlled by your hoster from the config for your VM from the host. You'll need to talk to them about this as only they can change it... unless you're on Digital Ocean in which case you may be able to do something from your control panel for the VM.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

aegersz
Posts: 66
Joined: 2016/04/04 07:42:58

Re: Centos 6.9 always chooses the oldest kernel no matter what

Postby aegersz » 2017/09/24 11:45:33

that's a thought, i will talk to my host ASAP.

thanks.

the symlink is fine BTW.

my host originally was a friend and it's a local setup in Sydney but my server is in Singapore.

aegersz
Posts: 66
Joined: 2016/04/04 07:42:58

Re: Centos 6.9 always chooses the oldest kernel no matter what

Postby aegersz » 2017/09/25 02:59:21

yes, it was my host.

you came through again ! fantastic.

many thanks.

aegersz
Posts: 66
Joined: 2016/04/04 07:42:58

Re: [SOLVED] Centos 6.9 always chooses the oldest kernel no matter what

Postby aegersz » 2017/09/25 11:48:57

My Host only supports 2.6.32-642.3.1.el6 so i have to "downgrade" my kernel and upgrade the one it's been booting from .. this is how i intend on downgrading my kernel:

1. download the right rpm with wget

2. run yum --disablerepo=\* install /etc/yum.repos.d/kernel-2.6.32-642.3.1.el6.centos.plus.x86_64.rpm

Code: Select all

yum --disablerepo=\* install /etc/yum.repos.d/kernel-2.6.32-642.3.1.el6.centos.plus.x86_64.rpm

[root@forum yum.repos.d]# yum --disablerepo=\* install /etc/yum.repos.d/kernel-2.6.32-642.3.1.el6.centos.plus.x86_64.rpm
Loaded plugins: auto-update-debuginfo, fastestmirror, priorities, security
Setting up Install Process
Examining /etc/yum.repos.d/kernel-2.6.32-642.3.1.el6.centos.plus.x86_64.rpm: kernel-2.6.32-642.3.1.el6.centos.plus.x86_64
Marking /etc/yum.repos.d/kernel-2.6.32-642.3.1.el6.centos.plus.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
Marking /etc/yum.repos.d/kernel-2.6.32-642.3.1.el6.centos.plus.x86_64.rpm to be installed
Marking /etc/yum.repos.d/kernel-2.6.32-642.3.1.el6.centos.plus.x86_64.rpm as an update to kernel-2.6.32-431.1.2.0.1.el6.x86_64
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-642.3.1.el6.centos.plus will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package              Arch                 Version                                         Repository                                                   Size
=============================================================================================================================================================
Installing:
 kernel               x86_64               2.6.32-642.3.1.el6.centos.plus                  /kernel-2.6.32-642.3.1.el6.centos.plus.x86_64               134 M

Transaction Summary
=============================================================================================================================================================
Install       1 Package(s)

Total size: 134 M
Installed size: 134 M
Is this ok [y/N]: n