How to Check the Linux Version on Your System

Information about the Ubuntu OS inside the settings menu

There are a few handy terminal commands we can use to obtain all the relevant information about the operating system installed on a Linux system. Of course, you can also check from GUI, though the method may vary depending on what desktop environment you are running.

What Comprises a Linux System

Asking “What version of Linux am I running?” could generate a few different answers. It depends on what information you’re looking for exactly. For example, do you want to know the version of the Linux kernel or just find out what distribution is installed?

Linux is comprised of multiple components, all with their own version names and numbers. All of the following would need to be included in a complete answer to the question of “What version of Linux is this?”:

  1. The version of the Linux kernel
  2. The distribution that is installed (i.e. Ubuntu, Fedora, Mint)
  3. The version of the distribution
  4. The edition of the operating system (i.e. Ubuntu Desktop vs. Ubuntu Server)
  5. The CPU architecture that the OS utilizes (32-bit or 64-bit)
  6. The desktop environment running (i.e. GNOME, KDE, Xfce)

Now, let’s move on to answering each of these points.

Check System Version with Terminal Commands

1. The hostnamectl command will tell you the operating system, kernel, CPU architecture, and other various information:

hostnamectl

Terminal output of the hostnamectl command on Ubuntu

In our Ubuntu test system, it also shows us the version of our operating system, “Ubuntu 20.04 LTS.” However, some distributions are not always specific enough to include the version number here. Take this screenshot from Manjaro for instance, where it only tells us the distribution name:

Terminal output of the hostnamectl command on Manjaro

2. The lsb_release command will give you some pretty specific information about your distribution version and even its codename. However, not every distribution comes with the correct package installed by default to run this command.

lsb_release -a

Terminal output of the lsb_release command

3. You can take a peek inside the /etc/os-release file, which almost always contains adequate information about your OS. Here we run the command on a CentOS system.

cat /etc/os-release

Terminal output from the os-release file on CentOS Linux

You could also try this command, which will check that directory’s other pertinent files for even more information:

cat /etc/*release

Terminal output from all the release files inside etc file on Manjaro Linux

4. If you just want to see the Linux kernel version and don’t need the other information, the quickest way to obtain that will be with the uname command.

uname -r

Terminal output of the uname command to see Linux kernel version

5. The commands above ought to suffice, but here’s one more for good measure: the /proc/version file.

cat /proc/version

Terminal output from the proc version file in Ubuntu Linux

Check System Version with GUI

If you are running a GUI, you can undoubtedly find information about your operating system in there as well. The instructions for finding it will vary depending on what desktop environment you’re running. In GNOME on Ubuntu, the information can be found in Settings > About.

Settings menu in GNOME on Ubuntu that shows operating system version and information

Leave a Reply

Your email address will not be published. Required fields are marked *