If you’re new to Linux, starting up a new machine, or just looking for more info on your server’s OS and Linux Kernel, you can easily check your system’s Linux version using one of several methods. Depending on your specific distribution, some of these methods may work better for you than others.
What is a Linux Version?
Linux versions are different distributions of the Linux operating system that are based on the Linux kernel. Some of the most popular Linux versions are Ubuntu, Debian, Fedora, and Mint. Each version has its own features, software repositories, and update cycles. Linux versions can be used for desktops, servers, smartphones, and other devices.
How to Check Linux Version
The first step in checking your Linux version is determining what it is you’re actually looking for. Are you trying to determine your system’s operating system: the name of your particular Linux distribution (such as Red Hat, CentOS, Ubuntu, etc.)? Or the actual version number of your Linux Kernel? Depending on what you’re looking for, there are different ways of accessing both.
If you’d like a quick way of checking both the OS and kernel, enter the following command into your Linux terminal:
When entered, this should output a list of information from the Systemd logs associated with your system’s hostname. Included in this information, you should find a line marked Operating System which contains the name of your Linux distribution, and a line below it marked Kernel, containing information on your Linux Kernel’s version number. Because this method relies on an OS with Systemd, it is possible this command won’t work for you, depending on the age and type of your particular Linux distribution.
Using lsb_release to Check OS
If you are trying to learn more information about your Linux distribution specifically, the command lsb_release can provide information on your package’s distributor, the distribution’s release number, and any possible codenames/secondary names associated with the distribution. Short for Linux Standard Base, the lsb_release command is only compatible with certain Linux distributions (those which it’s already installed on). If supported, this command should print an output with details on your system’s distribution package. If not compatible, the output “command not found: lsb_release” will be printed instead.
To test if your distribution supports lsb_release, use the following command:
Other Methods for Checking OS Version
If the lsb_release command isn’t working for your particular Linux distribution, there are several other methods available to determine your machine’s operating system.
If your Linux distribution is operating on Systemd, the following command can be used to output data on your system’s OS:
or by using:
*Note: this command typically outputs version info on a machine before prompting the user to log in.
If your version of Linux is really old, and none of these methods work for checking the operating system, try the following commands:
Used together, these commands should produce the OS name and version number of your Linux distribution.
Checking the Linux Kernel Version
If you’re more concerned with the version number of your system’s Linux Kernel than with the name of its distribution package, the uname command can provide useful information on the architecture of your kernel by printing an output with your kernel’s version number.
To print all the information associated with your kernel, use the command:
A breakdown of the information presented in the screenshot above is explained below:
- Linux is the OS kernel name.
- Hivelocity is the hostname.
- 5.14.0-162.6.1.el9_1.x86_64 is the kernel release.
- #1 SMP PREEMPT_DYNAMIC Tue Nov 15 07:49:10 EST 2022 is information about the last time the kernel was compiled.
- x86_64 is the machine architecture.
- x86_64 is the processor architecture.
- x86_64 is the operating system’s architecture.
- GNU/Linux is the operating system.
For a shorter version, use: uname -r
Common uname commands can be found below:
|uname -a||Prints all system information|
|uname -m||Prints the machine hardware name|
|uname -n||Prints the hostname|
|uname -p||Prints the processor type|
|uname -r||Prints the kernel release number|
|uname -s||Prints the kernel name|
|uname -v||Prints the kernel version|
You can also output information on the currently running kernel using the command:
This command prints info pulled from the contents of /proc/sys/kernel/ostype, /proc/sys/kernel/osrelease, and /proc/sys/kernel/version, and contains information on the Linux distribution as well as the kernel version.
- How to Check the Apache Version on a Linux Dedicated cPanel Server
- How to Change a Password in Linux
- How to Check if Your Linux Server is Under DDoS Attack
Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.
The Hivelocity Difference
With best-in-class customer service, affordable pricing, a wide-range of fully-customizable options, and a network like no other, Hivelocity is the hosting solution you’ve been waiting for.