Linux list all kernels

List Installed Kernels and Currently Running Kernel

List Installed Kernels and Currently Running Kernel

Q: Is there a way I can check to see a Linux system has a newer kernel installed? For example, if a system has installed a new kernel, but has not yet rebooted to load it?

A: Yes, you can check the currently running kernel as well as which kernels are installed. This will give you version numbers and you can see if there is an installed version higher than the running version.

Check of Current Kernel Version

To check which kernel is currently running on your system, use the uname command with the “release” or -r switch. This will output the kernel version (release) number.

List All Installed Kernel Versions

Now that you know which kernel version you are currently running, you can check the installed versions and see if there are any later releases.

For Debian based systems (Ubuntu, Mint, etc..) you can use dpkg, then use grep to filter the results and only show the kernel (linux-image).

$ dpkg --list | grep linux-image ii linux-image-4.15.0-29-generic 4.15.0-29.31 ii linux-image-4.15.0-50-generic 4.15.0-50.54 ii linux-image-generic 4.15.0.50.52 . OUTPUT TRUNCATED .

For RedHat or RPM based systems (CentOS, Fedora, etc..) you can query the rpm database using the rpm command.

$ rpm -q kernel kernel-5.0.10-300.fc30.x86_64 kernel-5.0.13-300.fc30.x86_64 kernel-5.0.16-300.fc30.x86_64

You can also use YUM and DNF to check installed kernels.

$ yum list kernel Installed Packages kernel.x86_64 5.0.10-300.fc30 @updates kernel.x86_64 5.0.13-300.fc30 @updates kernel.x86_64 5.0.16-300.fc30 @updates

Источник

Читайте также:  Как установить ultraiso на линукс

How To Check & List All Installed Kernels In Ubuntu Linux

How to list all Linux kernels in Ubuntu and how to check all available kernel version in Linux. You can check last kernel update in Linux and check previous kernel version in Linux using terminal. Let us learn how:

What Is Kernel In Linux In Simple Words

The kernel is a computer program at the core of a computer’s operating system and generally has complete control over everything in the system. It is the portion of the operating system code thatfacilitates interactions between hardware and software components.

A full kernel controls all hardware resources (e.g. I/O, memory, cryptography) via device drivers, arbitrates conflicts between processes concerning such resources, and optimizes the utilization of common resources e.g. CPU & cache usage, file systems, and network sockets.

The kernel is one of the first programs loaded on startup (after the bootloader) and henceforth handles the rest of startup as well as memory, peripherals, and input/output (I/O) requests from software, translating them into data-processing instructions for the central processing unit.

Linux/UNIX Based Systems have Monolithic Kernel. A monolithic kernel is an operating system architecture where the entire operating system is working in kernel space.

The monolithic model differs from other operating system architectures (such as the microkernel architecture) in that it alone defines a high-level virtual interface over computer hardware. A set of primitives or system calls implement all operating system services such as process management, concurrency, and memory management. Device drivers can be added to the kernel as modules.

Where Is The Kernel Image Located In Linux

There no universal standard, but the kernel is usually found in the /boot directory. Note that the Linux kernel image is conventionally named vmlinuz and stored under /boot but it can be given any name and stored at any location.

Читайте также:  Восстановление загрузчика linux boot repair

How To Check All Available Kernel Version In Linux

By default, all installed Linux Kernels and their associated files are stored under /boot directory named vmlinuz. To check all available Kernel version in Linux, run one of the following commands:

find /boot/vmli*
dpkg —list | grep linux-image
sudo dpkg ––list | egrep –i ––color ‘linux-image|linux-headers’
sudo dpkg ––list | egrep –i ––color ‘linux-image|linux-headers’ | wc –l

If you want to list all installed kernels on Ubuntu except current one, run the command:

If you wann to print the name of the kernel currently being used and the date of installation and update, run the uname command with -sv options.

Источник

How to List Installed Kernels in Ubuntu

Linus Kernels in Ubuntu

You can easily check the currently running Linux kernel in Ubuntu with the following command:

That’s well and good. But in Ubuntu, you have more than one Linux kernel installed at a moment.

How do you know which kernels are installed on your system? There is no specific command for that. You can use the package management commands for this purpose.

Listing installed Linux kernel on Ubuntu system

Ubuntu uses APT package management system. It can be accessed through the apt, dpkg and aptitude commands. The apt and dpkg commands are what you see in Ubuntu. The aptitude command is more for the Debian systems.

To list the currently available, use the apt command like this:

apt list --installed | grep linux-image

You don’t even have to be a sudoer to list the installed kernels.

The apt list —installed lists all the packages installed by the apt commands. You then use the grep command to only show the lines containing linux-image . The kernels in Ubuntu are named in linux-image-x.y.z format so checking for this specific term gives you the desired result i.e. the list of installed Linux kernels.

Читайте также:  Amd raid linux drivers

For a Ubuntu test server running on Digital Ocean, I see this result:

[email protected]:~# apt list --installed | grep linux-image WARNING: apt does not have a stable CLI interface. Use with caution in scripts. linux-image-5.15.0-33-generic/jammy-updates,jammy-security,now 5.15.0-33.34 amd64 [installed,auto-removable] linux-image-5.15.0-39-generic/jammy-updates,jammy-security,now 5.15.0-39.42 amd64 [installed,automatic] linux-image-5.15.0-40-generic/jammy-updates,now 5.15.0-40.43 amd64 [installed,automatic] linux-image-virtual/jammy-updates,now 5.15.0.40.42 amd64 [installed,automatic]

As you can see, my Ubuntu system has the following kernels available right now:

List installed kernels in Ubuntu

  • 5.15.0-33
  • 5.15.0-39
  • 5.15.0-40

That linux-image-virtual is basically soft linked to the latest (running) kernel version.

In older days, you would have had several kernels installed with the system updates. Things have changed these days and now Ubuntu only keeps two kernels at a time.

An additional kernel helps you in case there are some issues with the latest kernel and you have to boot into the system with the older one to access the system.

How come I have three kernels when Ubuntu only keeps two kernels at a time?

The kernel «5.15.0-33» is an older one and since I updated but did not reboot the server, it kept on running the old kernel. After the last reboot, 5.15.40 was chosen as the default kernel, 5.15.39 as the additional kernel. At the same time, 5.15.33 is marked to be auto-removable . If I run the ‘apt autoremove’ command, kernel 5.15.33 will be removed from the system.

This is the reason why you may see pending kernel upgrade message while updating Ubuntu at times.

That’s it. Now you know how to list the Linux kernels installed in your Ubuntu system.

Источник

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