Knowing your operating system version helps when installing compatible software packages. If you are wondering how to find linux os version, you have come to the right place. This guide will show you multiple ways to check your Linux version, whether you prefer using the terminal or a graphical interface. Let’s get started with the simplest methods first.
Linux comes in many distributions, each with its own version numbering. You might be using Ubuntu, Fedora, Debian, or CentOS. The commands to check the version are mostly the same across these distros. We will cover both command-line and GUI approaches so you can choose what works best for you.
How To Find Linux Os Version Using The Terminal
The terminal is the most reliable way to check your Linux version. Open a terminal window by pressing Ctrl + Alt + T on most systems. Once the terminal is open, you can run a few simple commands.
Using The Hostnamectl Command
The hostnamectl command is available on most modern Linux distributions. It shows detailed system information including the operating system version.
- Open your terminal.
- Type the following command and press Enter:
hostnamectl
You will see output similar to this:
Static hostname: my-pc
Icon name: computer-laptop
Chassis: laptop
Machine ID: xxxxxxxxxxxxxxxxxxxxxxxx
Boot ID: xxxxxxxxxxxxxxxxxxxxxxxx
Operating System: Ubuntu 22.04 LTS
Kernel: Linux 5.15.0-91-generic
Architecture: x86-64
The line "Operating System" shows the distribution name and version. In this example, it is Ubuntu 22.04 LTS. This command works on Fedora, Debian, and most other distros too.
Using The Lsb_Release Command
The lsb_release command is specifically designed to show LSB (Linux Standard Base) information. It is available on many distributions, but you might need to install it on some minimal systems.
- In the terminal, type:
lsb_release -a
The output will look like:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
If you get an error saying "command not found," you can install it using your package manager. For Debian/Ubuntu, use sudo apt install lsb-release. For Fedora, use sudo dnf install redhat-lsb-core.
Checking The /Etc/Os-Release File
Every Linux system has a file called /etc/os-release that contains operating system identification data. You can view it with the cat command.
- Run this command in the terminal:
cat /etc/os-release
You will see output like:
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
The PRETTY_NAME line gives you a human-readable version string. This file exists on almost all Linux distributions, making it a universal method.
Using The Uname Command For Kernel Version
Sometimes you need the kernel version rather than the distribution version. The uname command provides this information.
- Type the following command:
uname -a
This shows all system information including kernel name, network node hostname, kernel release, kernel version, machine hardware name, and operating system. A sample output is:
Linux my-pc 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
The kernel version here is 5.15.0-91-generic. If you only want the kernel release, use uname -r.
How To Find Linux Os Version Using Graphical Interface
Not everyone is comfortable with the terminal. Most desktop environments provide a graphical way to check the system version. The steps vary depending on your desktop environment.
On Ubuntu With Gnome Desktop
If you are using Ubuntu with the default GNOME desktop, follow these steps:
- Click on the "Activities" button at the top-left corner or press the Super key (Windows key).
- Type "Settings" in the search bar and open the Settings application.
- Scroll down in the left sidebar and click on "About."
- Look for "OS name" and "Version." You will see something like "Ubuntu 22.04.3 LTS."
This method works on most GNOME-based distributions like Fedora Workstation and Pop!_OS.
On Kde Plasma Desktop
For KDE Plasma users, the process is slightly different:
- Open the application launcher (usually the bottom-left menu icon).
- Click on "Settings" and then "System Settings."
- In the System Settings window, look for "About This System" under the "System" section.
- You will see the operating system name and version displayed prominently.
KDE also shows detailed hardware information in this screen.
On Xfce Desktop
Xfce users can find the version through the system menu:
- Click on the "Applications" menu at the top-left.
- Navigate to "Settings" and then "About Xfce."
- This window shows the Xfce version, but not always the distribution version.
- For the distribution version, open a terminal and use
cat /etc/os-release.
Some Xfce distributions like Xubuntu include a "System Info" tool in the settings menu.
How To Find Linux Os Version On Specific Distributions
Different Linux distributions may have unique commands or files. Here are methods for the most popular ones.
On Ubuntu And Debian
Ubuntu and Debian share similar commands. Besides the ones mentioned earlier, you can use:
cat /etc/debian_version– Shows the Debian version number.cat /etc/ubuntu-release– Shows Ubuntu release information.apt show ubuntu-release-upgrader– Shows version details if installed.
On Debian, the /etc/debian_version file contains the version number like "11.6" for Debian 11.
On Fedora And Red Hat
Fedora and Red Hat Enterprise Linux (RHEL) use different files:
cat /etc/fedora-release– Shows Fedora version.cat /etc/redhat-release– Shows RHEL or CentOS version.cat /etc/system-release– Another common file for these distros.
On Fedora, the output might be "Fedora release 38 (Thirty Eight)." For RHEL, it might be "Red Hat Enterprise Linux release 9.2 (Plow)."
On Arch Linux
Arch Linux is a rolling release, so there is no traditional version number. However, you can check:
cat /etc/arch-release– This file is usually empty or contains just "Arch Linux."pacman -Q core/filesystem– Shows the version of the filesystem package, which indicates the system age.uname -r– Shows the kernel version, which is updated regularly.
For Arch-based distros like Manjaro, you can check /etc/manjaro-release for version info.
On OpenSuse
openSUSE users can use:
cat /etc/os-release– Works as usual.cat /etc/SuSE-release– Older file, still present on some systems.zypper --version– Shows the package manager version, which correlates with the distribution version.
How To Find Linux Os Version Remotely
If you need to check the version of a remote Linux server, you can use SSH. This is common for system administrators managing multiple machines.
- Connect to the remote server using SSH:
ssh username@remote-server-ip
- Once logged in, run any of the commands mentioned earlier:
hostnamectl
Or
cat /etc/os-release
You can also combine the SSH connection with a command to get the version without opening an interactive session:
ssh username@remote-server-ip "cat /etc/os-release"
This runs the command on the remote server and prints the output to your local terminal. It is efficient for scripting and automation.
Common Issues When Checking Linux Version
Sometimes the commands do not work as expected. Here are some common problems and solutions.
Command Not Found Errors
If you get "command not found" for lsb_release, it means the package is not installed. Install it with:
- Debian/Ubuntu:
sudo apt install lsb-release - Fedora:
sudo dnf install redhat-lsb-core - Arch:
sudo pacman -S lsb-release
Alternatively, use cat /etc/os-release which is always available.
Empty Or Missing Files
Some minimal installations or container images might not have /etc/os-release. In such cases, try:
cat /etc/*release– Lists all release files.cat /etc/issue– Shows a short version string.uname -a– Shows kernel info but not distribution version.
If none of these work, you might be on a custom or very old system. Consider checking the package manager logs.
Virtual Machines And Containers
Virtual machines and Docker containers often have minimal files. The hostnamectl command might not work inside a container. Use cat /etc/os-release instead, which is usually present.
Why Knowing Your Linux Version Matters
Understanding your Linux version helps in several ways:
- Software compatibility: Some applications require specific kernel or library versions.
- Security updates: Knowing your version helps you check if security patches are available.
- Troubleshooting: When asking for help online, you need to provide your distribution and version.
- Upgrade planning: You can decide when to upgrade to a newer release.
For example, Ubuntu 20.04 LTS uses Python 3.8 by default, while Ubuntu 22.04 LTS uses Python 3.10. This difference can affect script compatibility.
Automating Version Checks With Scripts
If you manage multiple Linux systems, you can automate version checks. Here is a simple bash script that checks the version on a list of servers.
#!/bin/bash
# Check Linux version on multiple servers
servers=("server1.example.com" "server2.example.com" "server3.example.com")
for server in "${servers[@]}"; do
echo "Checking $server..."
ssh "$server" "cat /etc/os-release | grep PRETTY_NAME"
done
Save this script as check_version.sh, make it executable with chmod +x check_version.sh, and run it. It will print the PRETTY_NAME for each server.
You can also use tools like Ansible or Puppet for more advanced inventory management.
Frequently Asked Questions
What Is The Easiest Way To Check My Linux Version?
The easiest way is to open a terminal and type hostnamectl. This command works on most modern distributions and shows the operating system name and version clearly.
Why Does lsb_release -A Say "No LSB Modules Are Available"?
This message appears when the LSB modules are not installed. It does not affect the version information. You can still see the Distributor ID, Description, Release, and Codename in the output.
Can I Find The Linux Version Without Using The Terminal?
Yes, you can use the graphical settings menu. On GNOME, go to Settings > About. On KDE, go to System Settings > About This System. The exact steps depend on your desktop environment.
What Is The Difference Between Distribution Version And Kernel Version?
The distribution version refers to the specific release of your Linux distro, like Ubuntu 22.04. The kernel version is the core of the operating system, like 5.15.0. You can check the kernel version with uname -r.
How Do I Check The Linux Version On A Remote Server?
Use SSH to connect to the remote server and run cat /etc/os-release or hostnamectl. You can also run the command directly without an interactive session using ssh user@server "cat /etc/os-release".
Now you have multiple ways to find your Linux OS version. Whether you prefer the terminal or a graphical interface, you can quickly get the information you need. Remember to use cat /etc/os-release as a universal fallback if other commands do not work. Keep this guide handy for when you need to check versions on different systems.