How To Upgrade Bluehost CentOS Linux VPS Kernel

I have a VPS on BlueHost. The VPS runs CentOS 6. These days i learnt 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 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 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 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 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, you can see the CentOS version in the top right corner of the admin page.
    bluehost whm admin page centos version-1
  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 right panel.
    bluehost whm left navigation menu
  9. Beside this, WHM provide 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 softwares.
READ :   How To Resolve VirtualBox Guest Additions: Kernel Headers Not Found For Target Kernel Error

2. Get Current Linux OS Version.

Open a terminal and run cat /etc/redhat-release command to get 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 ELRepo repository. Most Enterprise Linux OS such as RedHat Enterprise, CentOS, Fedora etc all use ELRepo repository. It is developed by 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 more 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 above command execute complete, verify the ELRepo repository has been added in the system with below command.
    yum repolist

3.3 Install New CentOS Kernel Version.

  1. Run below command to install the newest ELRepo kernel version.
    yum --enablerepo=elrepo-kernel install kernel-ml
  2. Run below command to list all repository 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 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 below steps.

  1. Instal 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 linux kernel version has been updated, so if you need copy & paste between host and guest os, you need to reinstall guest additions software, you can refer 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.
READ :   How To Connect To BlueHost FTP Server With Root User And Download BlueHost Website Backup Files

Reference

  1. The Linux Kernel Archieves.

Leave a Reply

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.