Update Kernal CentOs 6 and cPanel or Fedora

Refreshing your CentOS, cPanel, or Fedora kernel is a breeze. Just remember a few key steps to avoid any hiccups.

Just a Quick Heads up: This guide is specifically for CentOS 6 and cPanel servers.

1. Limit the number of kernels installed

This helps prevent your /boot partition from filling up due to constant kernel additions.

First, log into your server using SSH

Then, type:

yum install yum-utils

package-cleanup --oldkernels --count=2

Next, modify /etc/yum.conf to set an install limit:

pico /etc/yum.conf

Add or update the following line: installonly_limit=2

Save with: Ctrl-O

Exit with: Ctrl-X

2. Refresh the kernel

For most VPSes, a symbolic link like /etc/grub.conf -> /boot/grub/grub.conf is already set up, so no need to manually update grub config.

To verify the symbolic link, type:

ls -la /etc/grub.conf

If it returns:

lrwxrwxrwx 1 root root 20 Sep 10 2015 /etc/grub.conf -> /boot/grub/grub.conf

No need to fret about the date, as long as it points to /boot/grub/grub.conf, you're good to go. If the symlink isn't there, you can either contact support for help or type these commands:

cp /boot/grub/grub.conf /root/grub.conf

rm /etc/grub.conf

cd /etc

ln -s /boot/grub/grub.conf /etc/grub.conf

You're now ready to update the kernel:

Type: yum update

Answer all questions with yes

You should see something like this:

Running Transaction

Installing : kernel-2.6.32-504.23.4.el6.x86_64 1/2

Cleanup : kernel-2.6.32-431.29.2.el6.x86_64 2/2

Verifying : kernel-2.6.32-504.23.4.el6.x86_64 1/2

Verifying : kernel-2.6.32-431.29.2.el6.x86_64 2/2

Removed:

kernel.x86_64 0:2.6.32-431.29.2.el6

Installed:

kernel.x86_64 0:2.6.32-504.23.4.el6

All done!

root@ls1 [/etc]#

Here's a single command to set kernel count and get the newest kernel:

[ ! -h /etc/grub.conf ] && mv -f /etc/grub.conf /boot/grub/grub.conf && ln -s /boot/grub/grub.conf /etc/grub.conf

yum install yum-utils -y && package-cleanup --oldkernels --count=2 -y && sed -i 's/installonly_limit=.*/installonly_limit=2/g' /etc/yum.conf && yum clean all && yum update -y

Time to restart your server:

Just type: reboot

  • 0 brukere syntes dette svaret var til hjelp
Var dette svaret til hjelp?

Relaterte artikler

Create and setup your own name (DNS) servers in WHM

Setting up your own private nameservers on a cPanel server has many benefits, most importantly...

Expanding Disk Space on VPS (SSD)

If you have requested additional SSD space, there may be a need for you to manually expand the...

Maintaining a CPanel/WHM VPS

If you have got a CPanel/WHM based VPS and are not sure on how you should monitor and maintain it...

Connect to your VPS via SSH

Learn how to connect to your Linux VPS via SSH. This guide will give you the process to connect...

Installing NGinx on a CPanel Server Manually

To install NGinx on cPanel servers we recommend you use the product NGinxCP available at...