RHCSA 8 Exam Practice Question 5 (The Linux Kernel Management)

What Should I know About The RHCSA Exam

RHCSA 8 exam practice question 5

Question

Upgrade the kernel to kernel-4.18.0-193.14.3.el8_2.x86_64, and configure the system to Start with the default kernel. Also, keep the old kernel available.

The question is based On Managing the Linux kernel In The RHCSA, 8 Course on this website. If you have gone through this course, solving this wouldn’t be a problem.

RHCSA, 8 Course

Linux Kernel Management (How to rightly update the Linux kernel)

Linux Kernel Management (Linux kernel Module)

Linux Kernel Management (Linux kernel optimization)

Ask Your Questions

Solution

1. confirm the current kernel the system is running on

[root@DRQAS1 ~]# uname -r

4.18.0-147.el8.x86_64

2. confirm the installed kernels on the system

[root@DRQAS1 ~]# rpm -qa kernel

kernel-4.18.0-147.el8.x86_64

you can see that on this system, we currently have one kernel installed which is the kernel the system is running on.

3. Install the new kernel.

NB: On my system, the rpm kernel package is in the location, “/media”.

[root@DRQAS1 ~]# ls -l /media

total 2848
-rw-r--r--. 1 root root 2910920 Aug 11 21:28 kernel-4.18.0-193.14.3.el8_2.x86_64.rpm
[root@DRQAS1 ~]# rpm -ivh /media/kernel-4.18.0-193.14.3.el8_2.x86_64.rpm

Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
        package kernel-4.18.0-193.14.3.el8_2.x86_64 is installed
[root@DRQAS1 ~]#

4. verify the installed kernels on the system

[root@DRQAS1 ~]# rpm -qa kernel
kernel-4.18.0-193.14.3.el8_2.x86_64
kernel-4.18.0-147.el8.x86_64

5. Restart the system so that the new installed kernel can take effect

[root@DRQAS1 ~]# reboot

6. confirm the system is running on the new kernel

[root@DRQAS1 ~]# uname -r

4.18.0-193.14.3.el8_2.x86_64

You can now see that the system will always start with the new kernel as the default kernel and the old kernel is still kept on the system.

NOTE: If we had used the command (rpm -Uvh), the old kernel will be gone and not kept.

RHCSA 8 exam practice question 5

Solution Summary

uname -r

rpm -qa kernel

rpm -ivh /media/kernel-4.18.0-193.14.3.el8_2.x86_64.rpm

rpm -qa kernel

reboot

uname -r

RHCSA 8 Exam Practice Question 5

Your feedback is welcomed. If you love others, you will share with others

6 Comments

  1. Hello Tekneed,

    I ran rpm -ql kernel to get the location of my kernel & I got contains no files even though I have two kernels installed.

    • The -l option will only list files in a package. Use “rpm -q kernel” or “rpm -qa kernel” to see the kernels on your system.

  2. @ The author,
    Some observations (I am not an expert) but from what I red and documented from valid sources:
    1. The rpm command does not solve dependencies. Are you you this is the only package kernel-4.18.0-193.14.3.el8_2.x86_64.rpm you have to install to have the kernel updated?
    2. From a guide for RHCSA that I am using it says to download these packages: kernel, kernel-core, kernel-headers, kernel-modules, kernel-tools, kernel-tools-libs. Have them in one directory and then sudo dnf install -y kernel* . Then dnf will install the new kernel along with dependencies.

    • Yes, rpm does not resolve dependencies. However, if you are given a package with a “.rpm” extension to install, which is in this case, the only way to do that is to use rpm. No other way.

      Secondly, yum/dnf resolves dependencies and can be used to install a kernel but the question already gave us a particular version of kernel to upgrade to and the file, which is in “/media” location, hence you can’t use yum/dnf. To know more about software installation in Linux, use this link (https://tekneed.com/software-installation-in-linux-package-manager-repos/)

      • Could you not just use [yum|dnf] localinstall /path/to/kernel-*?
        It performs a local install similar to rpm, but accounts for dependencies.
        Also, could you link to how to downgrade from rpm, after using `rpm -ivh`?
        This is something I have not learned in my studies and am struggling to find info elsewhere.

        “””
        [root@CentOS-01 ~]$ yum localinstall /tmp/kernel-4.18.0-294.el8.x86_64.rpm
        Last metadata expiration check: 1:38:57 ago on Sun 28 Mar 2021 12:18:17 PM MDT.
        Package kernel-4.18.0-294.el8.x86_64 is already installed.
        Dependencies resolved.
        Nothing to do.
        Complete!
        [root@CentOS-01 ~]$
        [root@CentOS-01 ~]$ dnf localinstall /tmp/kernel-4.18.0-294.el8.x86_64.rpm
        Last metadata expiration check: 1:38:43 ago on Sun 28 Mar 2021 12:18:17 PM MDT.
        Package kernel-4.18.0-294.el8.x86_64 is already installed.
        Dependencies resolved.
        Nothing to do.
        Complete!
        “””

Leave a Reply

Your email address will not be published.


*