
Maintaining security updates, software compatibility, and system administration all depend on knowing which version of Ubuntu you are using. Knowing your specific Ubuntu version and release number guarantees that you can install compatible software, apply required patches, and solve problems efficiently, whether you are running a server or working in a desktop environment.
From graphical interface options to command-line tools that are compatible with all Ubuntu editions, this thorough article guides you through four easy methods to verify your Ubuntu version.
How to Check Ubuntu Version (4 Easy Methods)
Method 1: Using the lsb_release Command (Terminal)
The lsb_release command is the most straightforward and widely known method for checking Ubuntu version information. This utility displays Linux Standard Base (LSB) and distribution details in a standardized format that works consistently across all Ubuntu versions and desktop environments.
Steps to check your Ubuntu version:
- Open your terminal using Ctrl + Alt + T
- Enter the command:
bash
lsb_release -a
This command displays comprehensive version information, including the distributor ID, description (containing the version number), release number, and codename.
The output appears in the following format:
text
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble
Viewing Specific Version Information:
The lsb_release command offers several useful options to display targeted information:
- Full version description: lsb_release -d
This displays only the description line, which includes the complete version number like “Ubuntu 24.04 LTS.” - Release number only: lsb_release -r
Use this to see just the version number (24.04) - Codename only: lsb_release -c
This shows the release codename, such as “noble” for Ubuntu 24.04
The lsb_release method is particularly valuable because it provides complete version information without displaying unnecessary details, and it works reliably on any Ubuntu system regardless of the desktop environment in use.
Method 2: Reading Configuration Files (Terminal)
Ubuntu stores version information in system configuration files that you can read directly using terminal commands. This method provides an alternative approach when you need to access raw system data.
Using /etc/os-release file:
The /etc/os-release file is the standardized file for operating system identification. Enter the following command:
bash
cat /etc/os-release
This displays comprehensive system information in key-value format:
text
NAME=”Ubuntu”
VERSION=”24.04 LTS (Noble Numbat)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=”Ubuntu 24.04 LTS”
VERSION_ID=24.04
VERSION_CODENAME=noble
Using /etc/lsb-release file:
The /etc/lsb-release file contains Linux Standard Base release information:
bash
cat /etc/lsb-release
Output example:
text
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION=”Ubuntu 24.04 LTS”
Key difference: The /etc/os-release file is the modern standard implemented across all systemd-based distributions including Ubuntu, Debian, Fedora, and others. While /etc/lsb-release provides LSB-specific information, /etc/os-release is the more reliable cross-platform standard.
Method 3: Using the hostnamectl Command (Terminal)
The hostnamectl command provides system hostname and related information, including your Ubuntu version and kernel details. This tool offers a broader view of your system beyond just the version number.
To use this method:
bash
hostnamectl
The output displays:
text
Static hostname: ubuntu-server
Icon name: computer-vm
Chassis: vm
Machine ID: 1234567890abcdef
Boot ID: abcdefghijklmnop
Virtualization: kvm
Operating System: Ubuntu 24.04 LTS
Kernel: Linux 6.8.0-31-generic
Architecture: x86_64
The hostnamectl method is particularly useful because it simultaneously displays your operating system version, Linux kernel version, system architecture, and hostname information in a single output. This method works regardless of your desktop environment and requires no special privileges to execute.
Method 4: Using the GUI (Graphical Method)
For Ubuntu desktop users who prefer graphical interfaces, checking the version is simple through system settings.
For modern Ubuntu desktop (GNOME):
- Click the Activities menu or power icon in the top-right corner
- Select Settings from the applications menu
- Navigate to the About tab (or Details, depending on your Ubuntu version)
- Your Ubuntu version appears under the OS Name or Ubuntu Version section
The graphical method provides additional system information, including your GNOME version, kernel version, and system architecture, alongside the Ubuntu version number.
Important Note: The graphical method may display a shortened version number (for example, “Ubuntu 24.04 LTS” instead of “Ubuntu 24.04.1 LTS”). If you need the complete version number with patch level details, use one of the terminal methods instead.
Why It’s Important to Check Ubuntu Version
1. Ensuring Software Compatibility
The default software versions, libraries, and configurations vary among Ubuntu versions. So, before installing applications or development tools, verifying your Ubuntu version ensures the software you are installing supports your specific distribution version and won’t encounter compatibility issues that could compromise system stability.
2. Security Updates and Maintenance
Ubuntu releases security patches and updates on version-specific schedules. Knowing your exact version number guarantees that you will know when security updates will be available and when your system reaches end-of-life support.
Standard releases are supported for nine months, but Long-Term Support (LTS) versions receive updates for five years.
3. Server Configuration and Deployment
Version consistency is essential when managing multiple Ubuntu servers or deploying apps across infrastructure. Checking versions ensures that all your fleet’s machines have compatible operating systems and are able to get regular updates and patches.
4. Troubleshooting and Technical Support
Providing your exact version number when requesting assistance from the Ubuntu community, forums, or official support channels enables support experts to recognize version-specific problems and offer precise fixes. The same issue may be handled differently by different Ubuntu versions.
5. Docker Container and Virtual Machine Management
If you are using Ubuntu in containerized environments or virtual machines, knowing your version helps match containers with appropriate host configurations and manage dependencies effectively across your infrastructure.
Comparing the Four Methods
Each method for checking your Ubuntu version has distinct advantages and use cases. Understanding the differences helps you choose the most suitable approach for your specific situation.
| Aspect | lsb_release -a | /etc/os-release | hostnamectl | GUI Settings |
| Ease of Use | Very Simple | Simple | Simple | Easiest (no commands) |
| Information Displayed | Version, release, codename | Complete OS details | OS, kernel, architecture | Version, GNOME version |
| Full Version Number | Yes (includes patch) | Yes | Yes | Varies; usually yes for major versions |
| Requires Terminal | Yes | Yes | Yes | No |
| Works on All Ubuntu Versions | Ubuntu 10.04+ | All modern Linux distros use it | Ubuntu 16.04+ (or when systemd adopted) | All desktop versions |
| Server Compatible | Yes (recommended) | Yes | Yes | No (desktop only) |
| Special Privileges | None required | None required | None required | None required |
| Output Format | Key-value pairs | Key-value pairs | Structured format | Visual interface |
| Remote Access (SSH) | Fully supported | Fully supported | Fully supported | Not available |
| Performance | Fastest | Fast | Fast | Slowest (UI overhead) |
| Cross-Distribution | Deprecated/Legacy Standard | Systemd standard | Systemd standard | Ubuntu specific |
Choosing the Right Method:
1. Choose lsb_release -a if: You require the most reliable command that is compatible with every version of Ubuntu. This offers comprehensive information in a clear format and is the official standard for version identification. Recommended for automated scripts and server environments.
2. Choose /etc/os-release if: You are working with modern Ubuntu systems (16.04 and newer) and need raw system data in a standardized format that works across other Linux distributions. This is best for automated configuration or shell scripts that need to parse version information.
3. Choose hostnamectl if: You need comprehensive system information beyond just the version, including kernel version, architecture, and virtualization details in a single command. Infrastructure documentation and system diagnostics are two areas where this approach is especially helpful.
4. Choose GUI Settings if: You are using Ubuntu desktop and prefer a graphical interface without opening a terminal. This method is fastest for quick visual confirmation but provides limited version precision. Not suitable for servers or situations requiring complete version numbers.
Summary
Checking your Ubuntu version is crucial for managing security and system administration. There are four reliable approaches available: Hostnamectl shows extensive system information, the graphical Settings menu offers rapid visual access, configuration files such as /etc/os-release provide raw system data, and lsb_release -a offers detailed terminal output.
While the GUI option is better suited for desktop users, terminal methods are advised for servers and scenarios requiring complete version precision. All methods work without special privileges and ensure your system remains secure, compatible with installed software, and aligned with your deployment standards.
Frequently Asked Questions
Q1. What is the quickest command to check my Ubuntu version?
Ans. The fastest and most reliable way to check your Ubuntu version is by opening the terminal with Ctrl + Alt + T and running lsb_release -a. This command provides complete version information in a single output. For just the version description, use lsb_release -d.
Q2. What should I do if the lsb_release command is not found?
Ans. If you encounter the “lsb_release: command not found” error, the lsb-core package is missing from your system. Install it using your package manager. For Debian-based systems like Ubuntu, run:
bash
sudo apt install lsb-core
After installation, the lsb_release command will be available.
Q3. Which method should I use for a server without a graphical interface?
Ans. For headless servers, use terminal-based methods. The lsb_release -a command is recommended as it provides the most comprehensive information. Alternatively, use hostnamectl, which also displays kernel and architecture information alongside the version.
Q4. Can I check the Ubuntu version on a remote server via SSH?
Ans. Yes, all terminal methods work over SSH connections. Connect to your remote server via SSH and run any of the terminal commands, such as lsb_release -a, cat /etc/os-release, or hostnamectl, to retrieve version information.
Q5. What’s the difference between the version number shown in the GUI and the terminal?
Ans. The GUI method may display a shortened version number (e.g., “24.04 LTS”), while terminal commands like lsb_release -a show the complete version including patch numbers (e.g., “24.04.1 LTS”). Use terminal methods when you need full version precision.
Q6. Does /etc/os-release work on all Ubuntu versions?
Ans. The /etc/os-release file is available on Ubuntu 16.04 and newer systems running systemd. For older Ubuntu versions, use lsb_release -a or //etc/lsb-release instead.
Q7. How often does Ubuntu release new versions?
Ans. Ubuntu releases new standard versions every six months, while Long-Term Support (LTS) versions are released every two years. Standard releases receive nine months of support, while LTS versions receive five years of support.
Q8. Can I check the version without root privileges?
Ans. Yes, all four methods work without requiring root or sudo privileges. The lsb_release, hostnamectl, GUI Settings, and file-reading commands are all accessible to regular users.
Q9. What does the codename (like “noble”) represent?
Ans. Ubuntu assigns alphabetical codenames to each release in sequence. For example, Ubuntu 24.04 LTS is codenamed “noble.” These codenames make it easier to reference specific releases in documentation and discussions.
Q10. How do I stay updated with my Ubuntu version information?
Ans. You can check for updates by running sudo apt update followed by sudo apt upgrade in the terminal. These commands refresh your package list and install available updates for your current Ubuntu version.