- Как проверить версию ядра в Linux
- How to Check the Kernel Version in Linux
- В этом руководстве мы покажем вам несколько разных способов узнать, какая версия ядра Linux работает в вашей системе.
- Использование uname команды
- Используя hostnamectl команду
- Использование /proc/version файла
- Вывод
- How To Find Which Linux Kernel Version Is Installed On My System
- Commands to find your Linux Kernel Version
- How to check kernel version on Linux server/desktop/laptop
- Understanding uname command options
- Find Linux kernel using /proc/version file
- How to find your Linux Kernel version using hostnamect
- Related media
- Conclusion
- List or Check Installed Linux Kernels using command line
- List or Check Installed Linux Kernels
- RedHat / CentOS / RHEL / Fedora Linux user
- To list / display current running kernel version
- Another outputs from my Ubuntu Linux 18.04 LTS desktop
- Find installed kernel version for Debian / Ubuntu / Pop!_OS Linux
- Arch Linux user
- SUSE Enterprise Linux or openSUSE Linux user
- How do I find manually compiled and installed kernels that aren’t in the package manager?
- Alpine Linux user
- How do I list custom compiled kernel?
- Conclusion
- Verify the Kernel Version on Linux Servers
- 3 Ways to Check Linux Kernel Version in Command Line
- How to find Linux kernel version
- 1. Find Linux kernel using uname command
- 2. Find Linux kernel using /proc/version file
- 3. Find Linux kernel version using dmesg commad
- How do you check your Linux kernel version and other information?
Как проверить версию ядра в Linux
How to Check the Kernel Version in Linux
В этом руководстве мы покажем вам несколько разных способов узнать, какая версия ядра Linux работает в вашей системе.
Ядро является основным компонентом операционной системы. Он управляет ресурсами системы и является мостом между аппаратным и программным обеспечением вашего компьютера.
Существуют различные причины, по которым вам может понадобиться узнать версию ядра, работающего в вашей операционной системе GNU / Linux. Возможно, вы отлаживаете проблему, связанную с оборудованием, или узнали о новой уязвимости в системе безопасности, затрагивающей более старые версии ядра, и хотите узнать, уязвимо ли ваше ядро или нет. Какова бы ни была причина, довольно просто определить версию ядра Linux из командной строки.
Использование uname команды
Команда uname отображает несколько системных сведений, включая архитектуру ядра Linux, имя версии и выпуск.
Чтобы узнать, какая версия ядра Linux работает в вашей системе, введите следующую команду:
Вывод выше показывает, что ядро Linux является 64-битным и его версия 4.15.0-54 , где:
- 4 Версия ядра.
- 15 — Большая ревизия.
- 0 — Небольшое изменение.
- 54 — Номер патча.
- generic — Распространение конкретной информации.
Используя hostnamectl команду
Вы можете использовать grep команду для фильтрации версии ядра Linux:
Использование /proc/version файла
/proc Каталог содержит виртуальные файлы с информацией о системной памяти, ядра процессора, смонтированные файловые системы и многое другое. Информация о работающем ядре хранится в /proc/version виртуальном файле.
Используйте cat или less для отображения содержимого файла:
Вывод будет выглядеть примерно так:
Вывод
Мы показали вам, как найти версию ядра Linux, работающую в вашей системе, из командной строки. Команды должны работать во всех популярных дистрибутивах Linux, включая Debian, Red Hat, Ubuntu, Arch Linux, Fedora, CentOS, Kali Linux, OpenSUSE, Linux Mint и многие другие.
Источник
How To Find Which Linux Kernel Version Is Installed On My System
I am a new proud Linux user. My question to you is – how do I check Linux Kernel version? How do I find my Linux Kernel Version installed on my PC? Any help would be greatly appreciated.
Introduction : The Linux kernel is the central (core) component of Linux operating systems. Its responsibilities include managing the system’s resources and the communication between hardware and software components. It also maintains the security of your system. Hence, finding out the version information is a good idea for patching and other sysadmin management tasks.
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | No |
Requirements | None |
Est. reading time | 1m |
Commands to find your Linux Kernel Version
To check Linux Kernel version, try the following commands:
- uname -r : Find Linux kernel version
- cat /proc/version : Show Linux kernel version with help of a special file
- hostnamectl | grep Kernel : For systemd based Linux distro you can use hotnamectl to display hostname and running Linux kernel version
Let us see all commands and examples in details.
How to check kernel version on Linux server/desktop/laptop
You need to use then uname command to print certain system information including kernel name. Type the following command to print kernel version number:
$ uname -r
Sample outputs:
So my Linux kernel version is 4.15.0-39, where:
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
- 4 : Kernel version
- 15 : Major revision
- 0 : Minor revision
- 39 : Patch level or number
- generic : Linux distro/kernel specific additional info
Understanding uname command options
To print certain system information you use uname command. It has the following options:
-a, OR —all | print all information |
-s, OR —kernel-name | print the kernel name |
-n, OR —nodename | print the network node hostname |
-r, OR —kernel-release | print the Linux kernel release |
-v, OR —kernel-version | print the kernel version |
-m, OR —machine | print the machine hardware name |
-p, OR —processor | print the processor type or “unknown” |
-i, OR —hardware-platform | print the hardware platform or “unknown” |
-o, OR —operating-system | print the operating system |
Find Linux kernel using /proc/version file
Another option is to type the following cat command:
$ cat /proc/version
Sample outputs:
How to find your Linux Kernel version using hostnamect
Type the hostnamectl command along with grep command:
$ hostnamectl
$ hostnamectl | grep Kernel
Related media
This tutorial is also available in a quick video format:
Conclusion
You learned three diffent commands to display and show Linux kernel version on screen. For more info see the following pages too:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник
List or Check Installed Linux Kernels using command line
H ow do I list all installed kernel on Linux operating system? How do I find out current kernel version?
You can use standard package listing command to list installed Linux kernels on your Linux operating systems. This page shows how to list kernel using the command line.
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | Yes |
Requirements | Linux command-line |
Est. reading time | 1m |
List or Check Installed Linux Kernels
The command varies from one Linux distribution to another. In other words, you need to type the command as per your Linux distro.
RedHat / CentOS / RHEL / Fedora Linux user
You need to use standard rpm command or yum command to list installed software. Type the following command at shell prompt:
$ rpm -qa kernel
Sample Outputs:
Here is another outputs from RHEL 8 server:
One can run the yum command/dnf command as follows:
yum list installed kernel
OR
dnf list installed kernel
Listing installed kernels on RHEL 8
To list / display current running kernel version
Type the following uname command:
$ uname -r
$ uname -mrs
Sample outputs:
Another outputs from my Ubuntu Linux 18.04 LTS desktop
Find installed kernel version for Debian / Ubuntu / Pop!_OS Linux
Use the dpkg command along with the grep command to list all installed kernel on your Debian or Ubuntu Linux, enter:
$ dpkg —list | grep linux-image
Sample outputs:
Let us see outputs from my Ubuntu Linux 18.04 LTS desktop:
Arch Linux user
Run the pacman command as follows:
pacman -Q | grep linux
SUSE Enterprise Linux or openSUSE Linux user
Execute the following rpm command:
rpm -qa | grep -i kernel
From my OpenSUSE 15.2 server:
How do I find manually compiled and installed kernels that aren’t in the package manager?
Try to locate them in /lib/modules/ directory using the ls command:
ls -l /lib/modules/
Alpine Linux user
Run the apk command:
# apk info -vvv | grep -E ‘Linux’ | grep -iE ‘lts|virt’
And we will see:
How do I list custom compiled kernel?
Use the following find command:
sudo find /boot/ -iname «vmlinuz*»
Here is what I see:
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
Please note that vmlinuz is the name of the Linux kernel executable. Typically stored in /boot/ directory. The vmlinuz is a compressed Linux kernel file. It is a bootable file for loading the Linux operating system into memory. On some older Linux distros including latest one, you may find another file called vmlinux. It also the kernel file but in a non-compressed and non-bootable format. To list files in /boot/ run the ls command:
ls -l /boot/
The Linux kernel is compiled by issuing the following command:
sudo make install
The kernel binary on the original UNIX operating system was called unix. When a new Unix kernel containing support for virtual memory was finally written at the University of California at Berkeley, the kernel binary was called vmunix. Hence, the Linux kernel binary is also known as vmlinuz.
Conclusion
You learned how to list installed Kernels version using a bash shell prompt. See how to compile Linux kernel for more information or visit official Linux kernel website here.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник
Verify the Kernel Version on Linux Servers
In this article and related video, we will be discussing how to check the kernel version in both Ubuntu and CentOS Linux. The following command works with all Linux distributions, such as Red Hat, CentOS, Debian, and Ubuntu. It also works on other UNIX-like operating systems such as HPUX, FreeBSD, OpenBSD, Solaris, etc. Use the following command to check which Linux kernel version your server is currently running.
Here’s the code to run from the command line.
uname -r
You should receive a result similar to the following.
The kernel version output from above can be interpreted with the following key: | ||
2.6.32-431.11.2.el6.x86_64 | ||
2 | = | The Main Kernel Version |
6 | = | The Major Revision |
32 | = | The Minor Revision |
431.11.2.el6 | = | The Minor Fix/Revision Detail |
For more information and options, we can review the manual page (or simply the man page) for uname. The man page provides the following additional information.
NAME: uname — print system information
SYNOPSIS: uname [OPTION].
DESCRIPTION: 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 (non-portable)
-i, —hardware-platform
print the hardware platform (non-portable)
-o, —operating-system
print the operating system
—help display this help and exit
—version
output version information and exit
Full documentation at:
or available locally via: info ‘(coreutils) uname invocation’
Источник
3 Ways to Check Linux Kernel Version in Command Line
Last updated October 29, 2020 By Abhishek Prakash 25 Comments
Brief: Wondering which Linux kernel version your system uses? Here are several ways to check your kernel version in the Linux terminal.
You may find yourself in a situation where you need to know the exact Linux kernel version being used on your system. Thanks to the powerful Linux command line, you can easily find that out.
Quick way to check Linux kernel version
You can use the following command to get the Linux kernel version:
uname -r
There are other ways to get even more detailed information about kernel. Read the rest of the article to learn it in detail.
In this article, I’ll show you various methods for finding out your kernel version and tell you what those numbers actually mean. If you prefer videos, here’s a quick one. Don’t forget to subscribe to our YouTube channel for more Linux tips.
How to find Linux kernel version
I am using Ubuntu while writing this article. But these commands are generic and can be used on Fedora, Debian, CentOS, SUSE Linux or any other Linux distribution.
1. Find Linux kernel using uname command
uname is the Linux command for getting system information. You can also use it to find out whether you’re using a 32-bit or 64-bit system.
Open a terminal and type in the following command:
The output will be something similar to this:
This means that you’re running Linux kernel 4.4.0-97, or in more generic terms, you are running Linux kernel version 4.4.
But what do the other digits mean here? Let me explain:
- 4 – Kernel version
- 4 – Major revision
- 0 – Minor revision
- 97 – Bug fix
- generic – Distribution-specific string. For Ubuntu, it means I’m using the desktop version. For Ubuntu server edition, it would be ‘server’.
You can also use the uname command with the option -a. This will provide more system information if you need it.
The output of the command should like this:
Let me explain the output and what it means:
- Linux – Kernel name. If you run the same command on BSD or macOS, the result will be different.
- itsfoss – Hostname.
- 4.4.0-97-generic – Kernel release (as we saw above).
- #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 – This means that Ubuntu has compiled 4.4.0-97-generic 120 times. A timestamp for the last compilation is also there.
- x86_64 – Machine architecture.
- x86_64 – Processor architecture.
- x86_64 – Operating system architecture (you can run a 32-bit OS on a 64-bit processor).
- GNU/Linux – Operating system (and no, it won’t show the distribution name).
But I’ll save you from information overload. Let’s see some other commands to find your Linux kernel version.
2. Find Linux kernel using /proc/version file
In Linux, you can also find the kernel information in the file /proc/version. Just look at the contents of this file:
You’ll see an output similar to what you saw with uname.
You can see the kernel version 4.4.0-97-generic here.
3. Find Linux kernel version using dmesg commad
dmesg is a powerful command used for writing kernel messages. It’s also very useful for getting system information.
Since dmesg provides an awful lot of information, you should normally use a command like less to read it. But since we’re here just to check the Linux kernel version, grepping on ‘Linux’ should give the desired output.
The output will have a few lines but you should be able to identify the Linux kernel version there easily.
How do you check your Linux kernel version and other information?
Of the three ways discussed here, I use uname all the time. It’s the most convenient.
What about you? Which command do you prefer for getting Linux kernel information?
Like what you read? Please share it with others.
Источник