Answered by the Webhosting Experts

How to Check Linux Version

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:

hostnamectl

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.

Screenshot showing the results of the hostnamectl command.

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:

lsb_release -a

Screenshot showing the results of the lsb_release -a 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:

cat /etc/os-release

Screenshot showing the results of the cat /etc/os-release command.

or by using:

cat /etc/issue

Screenshot showing the results of the cat /etc/issue command.

*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:

cat /etc/*release

Screenshot showinf the results of the cat /etc/*release command.

cat /etc/*version

Screenshot showing the results of the cat /etc/*version command.

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:

uname -a

Screenshot showing the results of the uname -a 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

Screenshot showing the results of the uname -r command.

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:

cat /proc/version

Screenshot showing the results of the cat /proc/version 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.

 

Popular Links

Looking for more information on Linux? Search our Knowledge Base!

Interested in more articles about Operating Systems? Navigate to our Categories page using the bar on the left or check out these popular articles:

Popular tags within this category include: Linux, Windows, Apache, CentOS, Debian, Fedora, RedHat, and more.

Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.

 

The Hivelocity Difference

Seeking a better Dedicated Server solution? In the market for Private Cloud or Colocation services? Check out Hivelocity’s extensive list of products for great deals and offers.

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.

Unsure which of our services is best for your particular needs? Call or live chat with one of our sales agents today and see the difference Hivelocity can make for you.

Need More Personalized Help?

If you have any further issues, questions, or would like some assistance checking on this or anything else, please reach out to us from your my.hivelocity.net account and provide your server credentials within the encrypted field for the best possible security and support.

If you are unable to reach your my.hivelocity.net account or if you are on the go, please reach out from your valid my.hivelocity.net account email to us here at: support@hivelocity.net. We are also available to you through our phone and live chat system 24/7/365.