Ubuntu is one of the most widely used Linux distributions in the world, catering to everyone from casual users to enterprise servers. Whether performing maintenance, installing compatible software, or reporting bugs, knowing which version of Ubuntu is running is crucial information. Fortunately, Ubuntu provides several quick and easy methods to determine the version directly from the Terminal.
Contents
Using the Terminal to Check Ubuntu Version
The Terminal is a powerful tool that lets users interact with the underlying system of Ubuntu. There are multiple commands that can reveal the version and other system details.
1. Using lsb_release Command
One of the most straightforward ways to check the Ubuntu version is to use the lsb_release
command. This utility displays Linux Standard Base and distribution-specific information:
lsb_release -a
This command will return output similar to the following:
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy
The “Description” and “Release” lines indicate the version and type of the operating system. “Codename” is often used in package repositories and development documentation.
2. Viewing /etc/os-release File
Another reliable method is reading the system file /etc/os-release
, which contains identification data about the OS:
cat /etc/os-release
Sample output:
NAME="Ubuntu" VERSION="22.04.2 LTS (Jammy Jellyfish)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 22.04.2 LTS" VERSION_ID="22.04"
This file is present across most Linux distributions and is highly readable. The PRETTY_NAME and VERSION_ID fields give the most user-friendly information.

3. Using hostnamectl Command
The hostnamectl
command, though primarily used for setting and displaying hostname information, also shows OS details:
hostnamectl
Example result:
Static hostname: ubuntu-server Icon name: computer-vm Chassis: vm Machine ID: xxxxxxxxxxxxxxxx Boot ID: yyyyyyyyyyyyyyyy Operating System: Ubuntu 22.04.2 LTS Kernel: Linux 5.15.0-60-generic Architecture: x86-64
This is especially useful on newer systems and virtual machines where other files might be customized or stripped down.
4. Checking the issue File
Older or minimal installations might benefit from checking the /etc/issue
file, which displays an identification message at login:
cat /etc/issue
Typical output:
Ubuntu 22.04.2 LTS \n \l
This method provides fewer details but may be helpful when other tools are unavailable.
5. Checking the Kernel Version
While not a direct indicator of the Ubuntu version, the kernel version can give clues about the system’s state:
uname -a
This presents details including kernel version, architecture, and system type.

Why Knowing the Version Matters
Understanding the Ubuntu version is essential because:
- Software Compatibility: Certain packages and dependencies work only on specific versions.
- Security Updates: Only supported versions receive updates.
- Community Support: Forums and documentation are version-specific.
FAQ: Checking Ubuntu Version
- Q: What is the quickest command to check the Ubuntu version?
A: Uselsb_release -a
for a fast and clear result. - Q: Can I check the Ubuntu version without root access?
A: Yes, all the commands listed above work without needing superuser privileges. - Q: Are these commands applicable to server editions?
A: Absolutely. These commands work on both desktop and server installations of Ubuntu. - Q: What does LTS mean in Ubuntu versions?
A: LTS stands for Long-Term Support, where Ubuntu provides updates and support for at least five years. - Q: Can I find this information through a GUI instead?
A: Yes, but a terminal-based approach is universal and doesn’t depend on desktop environments.
In conclusion, determining the version of Ubuntu via the Terminal is simple and efficient. Multiple commands and files are available, depending on the system configuration and user preference.