Oracle linux update kernel

Manage the Boot Kernel for Oracle Linux 8

Introduction

This tutorial describes how to set the default kernel of an Oracle Linux system from the command line. This tutorial is targeted at Oracle Linux 8 users, but the grubby command is also available on Oracle Linux 6 and Oracle Linux 7.

Background

By default, Oracle Linux systems are configured to boot the most recent kernel version first. In most cases, changing the default kernel is unnecessary.

However, the default kernel might not be the correct version to use in certain scenarios, such as the following:

  • The current kernel version might be incompatible with a particular hardware you are using.
  • Cases involving Unbreakable Enterprise Kernel (UEK) releases on the system
  • UEK releases are typically based on kernel versions that are newer than the Red Hat Compatible Kernel (RHCK) version on which an Oracle Linux release is based. Thus, the new UEK version becomes the default kernel, which is not the same as the Oracle Linux kernel.
  • If a UEK beta or technical preview release is installed on the system, the UEK kernel needs to be demoted to ensure that the kernel is used only if intentionally and manually selected as the boot kernel by an administrator.
  • A UEK kernel might need to be promoted because a specific software depends on it.

These examples and other similar cases would necessitate that you switch between kernel types.

In previous releases, setting the default kernel was performed by configuring the GRUB boot loader or by using other alternative commands. Now, however, you should preferrably use the grubby command to control and manage all of your boot requirements. This tool offers the benefit of being scriptable and can abstract bootloader configuration from the user.

Objectives

In this lab, you’ll learn how to:

  • determine the current loaded kernel
  • determine the default kernel
  • determine which kernel versions are available on the system
  • how to use grubby to manage kernels

What Do You Need?

  • Any Oracle Linux system that has the grubby package installed

(Hands-on Lab) Connect to the Compute Instance

Note: This step is specific to the Oracle provided free lab environment.

The Desktop environment will display before the instance(s) are ready. Deployment of this environment can take two to five minutes, depending on the number of resources and provisioning steps needed.

First, to access the lab compute instance(s), connect to the Oracle Cloud Console and copy the compute instance Public IP address.

  1. Sign in to Oracle Cloud Console, and select your Compartment.
  2. Click Instances.

Copy the Public IP to a temporary location (such as a text file) on your computer.

To copy, highlight the IP address with the mouse and press Ctrl+C.

Connect to the instance.

Where is the IP address copied from the Oracle Cloud Console.

Accept the ECDSA key fingerprint by typing yes at the prompt.

  • You are now connected to the compute instance for this lab.
  • If the connection fails with the Permission denied (publickey,gssapi-keyex,gssapi-with-mic) message, wait a bit longer for the provisioning process to complete and try making the ssh connection again.

    Check available kernels

    Several methods are available for checking which kernels are available on a system.

    Using the rpm command

    Note that the command output also includes other kernel related packages and can therefore be confusing.

    Listing the kernels in the /boot directory

    The command produces an accurate list of kernels available on the system. However, due to the way kernels are named, the kernel version that the system currently uses is not easily identifiable.

    Using the grubby command on specific kernels or using the ALL option:

    The command provides fuller information about the boot configuration associated with each kernel in the system’s /boot directory. The details are based on the GRUB title configuration.

    In general, kernels are named to include the upstream version number and the distribution build numbering. The kernel names on Oracle Linux also include indications of whether or not they are standard RHCK or whether they are UEK based. Additionally, the names also identify their system architecture. For example, the el8 suffix would indicate an RHCK, while el8uek would indicate a UEK.

    Читайте также:  Help with windows surface pro

    Check the current default kernel

    To check which kernel is already configured as the current default kernel to use at boot, run:

    To check which kernel is currently running on a system, run:

    If the default kernel and the currently running kernel are not identical, the underlying reasons might be one of the following:

    • A newer kernel is installed, but the system has not been rebooted.
    • During a system reboot, an alternative kernel was manually selected to be the operative kernel.
    • The default kernel was manually updated but the system has not been rebooted after the update.

    Change the default kernel

    To switch to a different default kernel, run the following command. Make sure to specify the full path to the designated default kernel.

    The change takes effect immediately and persists across system reboots.

    The grubby command has additional boot arguments for configuring kernel and boot operations. Refer to the documentation for more information.

    Change kernel command line boot parameters

    Use the —update-kernel option to update a kenel entry in combination with —args to add new arguments or —remove-arguments to remove existing arguments. Multiple arguments can be specified for each option in a quoted space-separated list. You can add and remove arguments in the same operation.

    To update a specific kernel, provide the —update-kernel option with the full path to the kernel that you wish to update. To update all kernel entries to use a specific kernel boot argument, you can set —update-kernel=ALL .

    For the purpose of this tutorial you can update all kernel entries to change the loglevel and LANG arguments:

    Use the grubby info=ALL command to check that the change is implemented across kernels:

    Video Demonstrations

    An introductory video that provides an overview of the kernel and underlying system architecture and which demonstrates switching kernel using the grubby command is provided at https://www.youtube.com/watch?v=a0zXGhzPRp8.

    A more advanced video demonstration and tutorial is provided at https://www.youtube.com/watch?v=0dv87RFGcKI if you need more information on working with GRUB2 on Oracle Linux 8.

    Note that this tutorial does not describe use of the grubby command and explains the underlying components that grubby interacts with. For most kernel management requirements on Oracle Linux, the grubby tool is sufficient.

    Additional Information

    More Learning Resources

    Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

    For product documentation, visit Oracle Help Center.

    Manage the Boot Kernel for Oracle Linux 8

    Copyright © 2021, Oracle and/or its affiliates.

    Источник

    OS Kernel Updates

    Note

    This topic applies only to Linux instances that were launched before February 15, 2017. Linux instances launched on or after February 15, 2017 boot directly from the image and do not require further action for kernel updates.

    Oracle Cloud Infrastructure boots each instance from a network drive. This configuration requires additional actions when you update the OS kernel.

    Oracle Cloud Infrastructure uses Unified Extensible Firmware Interface (UEFI) firmware and a Preboot eXecution Environment (PXE) interface on the host server to load iPXE from a Trivial File Transfer Protocol (TFTP) server. The iPXE implementation runs a script to boot Oracle Linux. During the boot process, the system downloads the kernel, the initrd file, and the kernel boot parameters from the network. The instance does not use the host’s GRUB boot loader.

    Normally, the yum update kernel-uek command edits the GRUB configuration file, either grub.cfg or grub.conf , to configure the next boot. Since bare metal instances do not use the GRUB boot loader, changes to the GRUB configuration file are not implemented. When you update the kernel on your instance, you also must upload the update to the network to ensure a successful boot process. The following approaches address this need:

    • Instances launched from platform images include an Oracle yum plug-in that seamlessly handles the upload when you run the yum update kernel-uek command.
    • If you use a custom image based on a platform image, the included yum plug-in will continue to work, barring extraordinary changes.
    • If you install your own package manager, you must either write your own plug-in or upload the kernel, initrd, and kernel boot parameters manually.

    Oracle Yum Plug-in

    On instances launched with a platform image, you can find the Oracle yum plug-in at:

    The plug-in configuration is at:

    The plug-in looks for two variables in the /etc/sysconfig/kernel file, UPDATEDEFAULT and DEFAULTKERNEL . It picks up the updates only when the first variable is set to «yes» and the DEFAULTKERNEL value matches the kernel being updated. For example:

    Читайте также:  Iastore sys синий экран windows 10 aida64

    Platform images incorporate the Unbreakable Enterprise Kernel (UEK). If you want to switch to a non-UEK kernel, you must update the DEFAULTKERNEL value to «kernel» before you run yum update kernel .

    Manual Updates

    Tip

    Oracle recommends using the Oracle yum plug-in to update the kernel.

    If you manually upload the updates, there are four relevant URLs:

    The first three URLs are for uploading files (HTTPВ request type PUT). The fourth URL is for activating the uploaded files (HTTP request type POST). The system discards the uploaded files if they are not activated before the host restarts.

    The kernel and initrd are simple file uploads. The cmdline upload must contain the kernel boot parameters found in the grub.cfg or grub.conf file, depending on the Linux version. The following example is an entry from the /boot/efi/EFI/redhat/grub.cfg file in Red Hat Linux 7. The highlighted text represents the parameters to upload.

    The following command returns what is being uploaded to the cmdline file.

    A typical response resembles the following.

    The following commands update the cmdline and initrd files, and then activate the changes.

    Источник

    Getting Started with Oracle Unbreakable Enterprise Kernel Release 2

    by Lenz Grimmer, March 2012

    How to replace your Linux kernel with Release 2 of Oracle’s Unbreakable Enterprise Kernel.

    Introduction

    This article describes how you can update your Oracle Linux systems to the latest version of the Unbreakable Enterprise Kernel. By switching to the latest Unbreakable Enterprise Kernel, you can get the latest innovations in mainline Linux. Switching is easy—applications and the operating system remain unchanged. There is no need to perform a full re-install; only the relevant RPM packages are replaced. You can obtain future updates easily from the Unbreakable Linux Network to keep your systems fully patched and secured.

    At the time of this publishing, Unbreakable Enterprise Kernel Release 2 (version 2.6.39) was just released as an update for the first Unbreakable Enterprise Kernel (version 2.6.32). To learn more about the new features and benefits of using Unbreakable Enterprise Kernel Release 2, see the feature overview page and the release notes.

    The examples used below are based on these versions, but a similar procedure should work for future kernel update releases as well.

    This article describes two different installation methods:

    • The first method, using the Oracle Unbreakable Linux Network, requires a valid Oracle Linux Support subscription.
    • The second method involves obtaining the Unbreakable Enterprise Kernel from the public yum package repository.

    It is assumed that you already have Oracle Linux 5 or 6 installed and you are running either the Unbreakable Enterprise Kernel Release 1 (2.6.32) or the Red Hat–compatible kernel (2.6.18 on Oracle Linux 5, 2.6.32 on Oracle Linux 6).

    Unbreakable Enterprise Kernel Release 2 can be installed on Oracle Linux 5 Update 8 or newer, as well as on Oracle Linux 6 Update 2 or newer. If you’re still running an older version of Oracle Linux, make sure you first update your system to the latest available minor release.

    About the Unbreakable Enterprise Kernel for Oracle Linux

    Oracle Linux with the Unbreakable Enterprise Kernel is Oracle’s fully supported, tested, and certified Linux operating system for the enterprise. Oracle Linux is free to download, use, and distribute, and it is optimized to run Oracle hardware, databases, and middleware. You can obtain ISO images of the installation media from the Oracle Software Delivery Cloud without charge (requires registration).

    The Oracle Linux base distribution is 100% userspace-compatible with Red Hat Enterprise Linux (RHEL). However, the Unbreakable Enterprise Kernel is released on an independent schedule and is always based on a recent version of the mainline Linux kernel. As a result, it delivers the latest innovations from mainline Linux, combined with tested performance and stability. It is installed and booted by default; major updates of the Unbreakable Enterprise Kernel are usually published every 12 to 18 months.

    Installing the Unbreakable Enterprise Kernel from the Unbreakable Linux Network

    The Unbreakable Linux Network (ULN) is a comprehensive and easy-to-use Website for Oracle Linux Support subscribers, which offers access to Linux software patches, updates, and fixes, along with documentation and support policies.

    In order to get access to ULN you need to have a valid support subscription, which you can purchase online from the Oracle Linux Store.

    Once you have successfully logged in to ULN, you first need to register your system. See the Unbreakable Linux Network FAQ for more details about this process. When you register a server, it is automatically subscribed to a channel that provides the latest Oracle Linux packages and updates for the respective version and architecture.

    Читайте также:  No module named pip windows venv

    Continuously updated packages of the Unbreakable Enterprise Kernel are made available on ULN in a separate channel; you need to be subscribed to the appropriate channel for your system’s operating system version.

    Once your system is registered with ULN, you need to subscribe the system to the Unbreakable Enterprise Kernel Release 2 channel for your distribution.

    The following example shows how to use the ULN Website to subscribe an Oracle Linux 6.2 (64-bit) system running Unbreakable Enterprise Kernel Release 1.

      Log in to ULN with your user account and click the Systems tab to get a list of all systems that are currently registered with ULN (see Figure 1).

    Figure 1. ULN System Profiles

    When you click a machine name, you will see the system’s details, the channels it is subscribed to, and the list of available patches (see Figure 2).

    Figure 2. ULN System Details

    When you click a machine name, you will see the system’s details, the channels it is subscribed to, and the list of available patches (see Figure 2).

    Click Manage Subscriptionsto subscribe the system to the additional channel that provides the updated Unbreakable Enterprise Kernel packages. The channel will be displayed in the list of available channels (see Figure 3).

    Figure 3. ULN List of Available Channels

    Figure 4. Channel Added to List of Subscribed Channels

    Your system is now subscribed to receive the latest build of Unbreakable Enterprise Kernel and all subsequent future updates.

    The naming scheme for the Unbreakable Enterprise Kernel channels is the following:

    ol6_x86_64_UEK_latest
    Verify that the subscription succeeded by running yum repolist on the system:

    As you can see, the ol6_x86_64_UEK_latest repository is now enabled in addition to the default update repository.

    To see the list of available updates for this newly added repository, use the following command:

    Listing 1. Downloading and Installing Available Updates

    Congratulations, you have successfully installed the latest version of the Unbreakable Enterprise Kernel! Now, skip to the Postinstallation Tasks and Next Steps section to finish the installation.

    Installing the Unbreakable Enterprise Kernel from the Public Yum Repositories

    The initial releases of Oracle Linux and the Unbreakable Enterprise Kernel are freely available as individual RPM packages from the public yum repository.

    You just need to add and enable the dedicated Unbreakable Enterprise Kernel yum repository to update to the current kernel version. This can be done by adding the appropriate yum repository configuration file and enabling the respective repository.

      Start by downloading the corresponding repository configuration file.

    For Oracle Linux 5, run the following command:

    For Oracle Linux 6, run the following command:

    Listing 2. Checking for Updates and Installing the New Packages

    The Unbreakable Enterprise Kernel Release 2 has now been installed.

    Postinstallation Tasks and Next Steps

    At this point, you need to reboot your system in order to enable the newly installed kernel. You will notice that the GRUB boot menu includes a new entry for the updated kernel version, which will be booted by default.

    After rebooting, you can verify the kernel version number by running uname -r:

    You can now enjoy the latest improvements and developments in Linux delivered by the Unbreakable Enterprise Kernel, without having to re-install your entire operating system or applications.

    The dedicated Unbreakable Enterprise Kernel repository also includes additional and updated packages and tools that are required to enable or work with new kernel features. Some of these are updates for already existing packages, while others need to be installed manually.

    For example, if you want to start using the B-tree file system (Btrfs), make sure you install the btrfs-progs package, as shown in Listing 3.

    Listing 3. Installing the Package for Btrfs

    Similarly, there will be additional packages for other newly introduced features, for example, features for using and managing Linux Containers (lxc).

    Conclusion

    This article described two methods you can use to update your Oracle Linux systems to the latest version of the Unbreakable Enterprise Kernel. Future updates can be obtained easily from the Unbreakable Linux Network to keep your systems fully patched and secured. With the help of Ksplice, applying these updates can even be performed without having to schedule any downtime or reboots.

    Resources

    Here are URLs for the resources referenced earlier in this document:

    If you would like to learn more about the new features of Unbreakable Enterprise Kernel Release 2, see the following articles and blog posts:

    Also check out the following resources for news and articles related to Oracle Linux and the Unbreakable Enterprise Kernel:

    Источник

    Оцените статью