How to Check Linux Version

If you’re managing a Linux server or desktop, knowing which version of the operating system you’re running is essential. Whether you’re troubleshooting, installing compatible software, or updating your system, identifying your Linux version helps you make the right decisions.

In this post, we’ll show you how to check your Linux version in Ubuntu 24.04 (Noble Numbat) and other distributions using simple commands.


🔹 1. Check Ubuntu Version Using /etc/os-release

The most reliable and recommended way to check your Ubuntu version is by viewing the /etc/os-release file.
Run this command in your terminal:

cat /etc/os-release

Example output:

PRETTY_NAME="Ubuntu 24.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.2 LTS (Noble Numbat)"
VERSION_CODENAME=noble
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=noble
LOGO=ubuntu-logo

From this output, you can clearly see that the system is running:

Ubuntu 24.04.2 LTS (Noble Numbat)

This file also provides links to Ubuntu’s homepage, support, and bug report resources.


🔹 2. Check Version Using the lsb_release Command

If lsb-release is installed, you can use this simple command:

lsb_release -a

Example output:

Distributor ID: Ubuntu
Description:    Ubuntu 24.04.2 LTS
Release:        24.04
Codename:       noble

This method gives you the distribution name, release version, and codename in a clean format.

💡 Tip: If you get “command not found,” install it using
sudo apt install lsb-release -y


🔹 3. Check Kernel Version

To check the Linux kernel version, use:

uname -r

Example output:

6.8.0-35-generic

You can also use this command for more details about your system:

uname -a

🔹 4. Check Version Using hostnamectl

If you’re using a system with systemd, another easy way is:

hostnamectl

Example output:

Operating System: Ubuntu 24.04.2 LTS
Kernel: Linux 6.8.0-35-generic
Architecture: x86-64

This command also shows information about your kernel, architecture, and hostname.


✅ Conclusion

Checking your Linux version is simple but extremely useful for system management, compatibility checks, and software installation.

For Ubuntu 24.04 and other Debian-based distributions, the /etc/os-release file provides the most accurate and detailed information.


📌 Quick Summary:

CommandPurpose
cat /etc/os-releaseShows full OS information
lsb_release -aDisplays version and codename
uname -rShows Linux kernel version
hostnamectlShows OS, kernel, and architecture

Tags: Ubuntu 24.04, Linux Commands, System Administration, Noble Numbat, DevOps, Linux Basics

Leave a Comment