Checking your Linux Version

Configurare noua (How To)

Situatie

The term “Linux version” in the context of Linux operating systems typically refers to the specific distribution and version of the Linux kernel that is running on a given system.

For those you don’t know, the Linux kernel is the foundation of the Linux operating system, providing the fundamental services and functionality required to run applications and manage system resources. Each Linux distribution contains a specific version of the Linux kernel and a set of tools and utilities designed to work with that kernel version. Different Linux distributions may also include different packages, libraries, and software applications.

Solutie

Run the uname Command to Get Linux Kernel Version

The command uname displays system information such as the Linux kernel architecture, name, version, and release. We recommend the following command syntax in the terminal:

# uname -srm

uname -srm

The output above indicates that the Linux kernel is 64-bit and has the version “5.4.0-139-generic x86_64. This command is often useful when you need the CentOS kernel version quickly.

Print Linux Kernel Version from the /proc/version File

The /proc/version file contains important information about the LInux kernel, the system compiler, and related information. We recommend using the cat command to print this file in the terminal:

# cat /proc/version

Get Linux Kernel Version Information from dmesg

Linux installations include the dmesg (short for diagnostic messages) utility that prints out the contents of the kernel buffer. Since the output of this command can be long, we recommend the following syntax that filters out irrelevant information.

# dmesg | grep Linux

This output shows the installed Linux kernel and its importance in working with the system hardware.

How to Check Linux Version on Your System

You can check Linux version on your system by using one of the following methods.

Use the lsb release Utility

The lsb release utility displays information about the Linux distribution’s Linux Standard Base(LSB). This command should work on any Linux distribution that includes the lsb-release package. The syntax of the command is as follows:

# lsb_release -a

$ lsb_release -a

The Description line displays the Linux distribution and version. As you can see, the test system is running Ubuntu 20.04.3 LTS.

If you simply want the version information without any clutter, use the -d switch to display just the description line, which displays version information.

Ubuntu 20.04.3 LTS.

Check the /etc/os-release File for Linux Version Information

The /etc/os-release file contains operating system identification data and distribution information. This file is included in the systemd package and is present on any system that uses systemd.

# cat /etc/os-release

# cat /etc/os-release

Print Linux Version Information From the /etc/issue File

The /etc/issue file includes system identification text that appears before the login prompt. This file usually contains information about the Linux version:

# cat /etc/issue

Print Out the /etc/issue file

Use the /etc/*release file

If none of the above commands work for you, you are likely running an old and out-of-date Linux distribution. Traditionally, Linux version information was not included in the distribution’s files. While extremely rare, you may encounter these distributions in outdated devices.

If this is the case with you, we recommend the following command to print the contents of the distribution release or version file.

# cat /etc/*release

/etc/*release file

Get Linux Version Information from the /etc/*version File

The /etc/*version file is considered an alternative to the /etc/*release file. If the *release file is missing, you can try the following command to get the Linux distribution information:

# cat /etc/*version

# cat /etc/*version

This command queries the *version that was often present in older Linux distributions.

Some Linux distributions come with custom files that contain version information. For instance, if you are on Red Hat, we suggest the following command to check the distribution version:

# cat /etc/redhat-release

Similarly, if you are running Fedora, run this command:

# cat /etc/fedora-release

If you are more comfortable using the systems’ GUI, you can follow these steps to get the Linux version installed on your machine. We will cover the steps of the general process:

  1. Click the Activities button in the lower or upper-left corner of the desktop.
  2. Enter “system” in the search bar. Alternatively, you can launch the system information application.
  3. In the System Information/Settings window, click “Details” to see the Linux distribution information such as name and version information.

In popular Linux distributions, this process is implemented with minor variations.

Follow these instructions in all stable Ubuntu versions:

  1. Click  the Activities button
  2. Enter System Settings in the search bar
  3. Check Linux version information in the Details tab.

Follow the instructions to check Fedora version:

  1. Click the Show Applications button.
  2. Enter Settings in the search bar.
  3. Get Linux version information from the About tab.

If you are on a CentOS system, follow the instructions below:

  1. Click the Applications button
  2. Go to System Tools > Settings
  3. Get the Linux version information from the System tab.

How to Check General Linux Information

Sysadmins and users often need to quickly check system information during network setups and troubleshooting. During these scenarios, the user needs several information items including Linux distribution, Linux version, and kernel version.

Many systemd-based Linux distributions offer a simple way of getting all this information through the following command:

# hostnamectl

 

Note that this command will work in popular Linux distributions such as Fedora, Cent OS, Red Hat, Debian, Ubuntu, OpenSUSE, and Arch.

Finally, we suggest the neofetch utility to get a very user-friendly view of the system’s Linux version and related information. The utility is often preinstalled on many Linux distributions. However, if it is missing on your system, you can easily install it by calling the default package manager.

Next, launch the utility by calling it at the prompt:

# neofetch

Knowing which version of Linux is installed on a system is helpful for various reasons, including troubleshooting, ensuring compatibility with specific software applications, and simply staying up to date with the latest features and security patches.

Checking Linux version is such an important task that it is often among the first checks carried out when you try to install a package on your Linux machine. In most cases, if there is a discrepancy between the package dependencies and the active Linux version on your device, you‘ll get a warning about the incompatibility.

You should also know that the Linux version is also important from the security perspective. As vulnerabilities are discovered, developers release fixes that are usually targeted to a specific version. This means you need to be careful about the patches you download and install on your machine.Given this importance, how to check Linux distribution version, including the distribution’s command line interface, graphical user interface, or system information tools is a critical operational requirement.

Unlike other operating systems, Linux is not a single entity. It comes in various flavors called Linux distributions (more popularly, Linux distros). A distribution is a complete operating system with the Linux kernel at its core. The distribution maintenance team adds various utilities and software components to build their own version of the Linux operating system.

Traditionally, a Linux distribution comprises of the following components:

  • Linux Kernel: The central piece of the operating system. It offers low-level functionality, hardware abstraction/interface, and important device drivers.
  • System Libraries: A set of system libraries (typically the GNU C Library (glibc)). The distribution uses these for essential system functions. System applications also use these libraries for interfacing with the underlying OS.
  • User Interface: Linux distributions offer a choice of GUI (GNOME, KDE, or Xfce) and CLIs. Users use these UIs to interact with the system and third-party applications.
  • Software Packages: All major Linux distributions maintain their versions of software packages in their official repositories. The distribution maintenance team takes care of updating these packages and ensuring compatibility.
  • Package Management System: These systems offer a streamlined way of installing, removing, and updating packages on the system.

As you can see, the Linux kernel is an important part of a Linux system. All essential components and operations connect to it at some level to translate high-level requests into lower-level operations.

Tip solutie

Permanent

Voteaza

(5 din 13 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?