How To Upgrade Bluehost CentOS Linux VPS Kernel

I have a VPS on BlueHost. The VPS runs CentOS 6. These days I learned that if I enable tcp_bbr in the VPS, then it will use full bandwidth and will not waste any network bandwidth bit. So I want to enable the tcp_bbr for it. But tcp_bbr is supported only in Linux kernel which version is bigger than 4.9. And Bluehost CentOS Linux kernel is just 2.6. So I need to upgrade the Linux kernel to a higher version.

1. Get Current Linux Kernel Version.

  1. Open a terminal and ssh to the Bluehost VPS.
  2. Then run the command uname -r to return the Linux kernel version.
    # uname -r
    2.6.32-754.23.1.el6.x86_64
  3. To get full Linux server information run the command uname -a command.
    # uname -a
    Linux server.abc.com 2.6.32-754.23.1.el6.x86_64 #1 SMP Thu Sep 26 12:05:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  4. To get more help you can run the command uname –help command in ssh terminal.
    # uname --help
    Usage: uname [OPTION]...
    Print certain system information.  With no OPTION, same as -s.
    
      -a, --all                print all information, in the following order,
                                 except omit -p and -i if unknown:
      -s, --kernel-name        print the kernel name
      -n, --nodename           print the network node hostname
      -r, --kernel-release     print the kernel release
      -v, --kernel-version     print the kernel version
      -m, --machine            print the machine hardware name
      -p, --processor          print the processor type or "unknown"
      -i, --hardware-platform  print the hardware platform or "unknown"
      -o, --operating-system   print the operating system
          --help     display this help and exit
          --version  output version information and exit
    
  5. You can get all the above information in BlueHost provided WHM tool which is a VPS control panel.
  6. Login to the WHM admin page, you can ask Bluehost live support to get the WHM url and account.
  7. After login WHM admin console, you can see the CentOS version in the top right corner of the WHM admin page.
  8. To get more about your VPS server information, just click Server Status —> Server Information menu item in WHM left panel. Then it will list all VPS server information in the right panel.
  9. Besides this, WHM provides a lot of functions that can be used for you. For example, you can click WHM —> Software —> System Update / Update Server Software menu to update server-side software.

2. Get Current Linux OS Version.

  1. Open a terminal and run cat /etc/redhat-release command to get the current Linux OS version.
    # cat /etc/redhat-release
    CentOS release 6.10 (Final)
    

3. How To Upgrade Linux Kernel In CentOS 6.

We will upgrade the CentOS kernel from the ELRepo repository. Most Enterprise Linux OS such as RedHat Enterprise, CentOS, Fedora, etc all use the ELRepo repository. It is developed by the community. ELRepo release contains packages related to hardware drivers, filesystem drivers, network drivers, graphic drivers, sound card drivers, webcam, and others.

3.1 Update and Upgrade CentOS Packages.

  1. Run command yum -y update to upgrade all CentOS packages to the newest version.
    yum -y update
  2. Run command yum -y install yum-plugin-fastestmirror to install yum plugin to make packages install and update process faster.
    yum -y install yum-plugin-fastestmirror

3.2 Add ELRepo Repository.

  1. Add ELRepo gpg key to the system.
    rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
  2. Add new ELRepo repository with below rpm command.
    rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
  3. When the above command executes complete, you should verify the ELRepo repository has been added to the system with the below command.
    yum repolist

3.3 Install New CentOS Kernel Version.

  1. Run the below command to install the newest ELRepo kernel version.
    yum --enablerepo=elrepo-kernel install kernel-ml
  2. Run the below command to list all repositories with their status installed in CentOS.
    yum repolist all

3.4 Configure Grub2 on CentOS.

  1. Run awk command to check all available kernel versions in the Grub2.
    sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
  2. Change the default kernel when Linux is started.
    sudo grub2-set-default 0
  3. Run ‘grub2-mkconfig‘ command to generate the grub2 config, and reboot the Linux server.
    sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    sudo reboot
  4. Now you can check the new Linux kernel version by run command uname -snr.
    uname -snr

3.5 Remove The Old Linux Kernel.

If you do not need the old Linux kernel anymore, you can remove it follow the below steps.

  1. Install yum-utils from the repository.
    yum install yum-utils
  2. Remove old Linux kernel.
    package-cleanup --oldkernels

3.6 Reenable Copy & Paste Between VirtualBox Host And Guest OS.

If you upgrade the CentOS Linux kernel in a VirtualBox virtual machine because the Linux kernel version has been updated, so if you need to copy & paste between host and guest os, you need to reinstall guest additions software, you can refer to the below articles.

  1. How To Enable Copy Paste ( Shared Clipboard ) Between VirtualBox Host And Guest OS.
  2. How To Resolve VirtualBox Guest Additions: Kernel Headers Not Found For Target Kernel Error.

Reference

  1. The Linux Kernel Archives.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.