How to Find Out Ubuntu Version: 6 Methods

2 min


A simple guide, showing five methods to find the installed Ubuntu version of your desktop and servers via GUI and CLI methods.

Usually, if you are well-known about the Ubuntu release cycle, you probably know what Ubuntu desktop or server version you are running in your system. Generally, there are two Ubuntu versions per year and one LTS (long-term support) version every two years.

Having said that, it’s always a good idea to check what version you are running for development projects and compatibilities. Here’s how to find the Ubuntu version.

This article is part of the Linux command learning series.

Find Ubuntu Version in Five Ways

1. Using Linux Standard Base (lsb) package

The most easier way is to use the Linux Standard Base package or lsb-release from Debian. Simply run the following from the command line to find out the Ubuntu version.

lsb_release -a

It should give an output similar to the below:

Distributor ID: Ubuntu
Description: Ubuntu 22.10
Release: 22.10
Codename: kinetic

You can also use the option -d to get only the description:

lsb_release -d
Output:
Description: Ubuntu 22.10

2. Using /etc/os-release

The /etc/os-release file contains details about the installed Ubuntu version in modern releases (version 16.04 onwards). You can display its contents using the cat command to find out the version. Run the following command to display the file content.

cat /etc/os-release
PRETTY_NAME="Ubuntu 22.10"
NAME="Ubuntu"
VERSION_ID="22.10"
VERSION="22.10 (Kinetic Kudu)"
VERSION_CODENAME=kinetic
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=kinetic
LOGO=ubuntu-logo

3. Using /etc/issue file

There is another file which contains one single line of text describing the Ubuntu version. The file name is /etc/issue. You can use the cat command or use any text editor to display its contents.

cat /etc/issue
Ubuntu 22.10 \n \l

4. Using hostnamectl

Since modern Linux distros, including Ubuntu, have moved to Systemd init system, you can also use its built-in utility hostnamectl to show the Ubuntu version. The hostnamtctl command can show many useful information alongside the Ubuntu version. Run the command from the terminal to find out:

hostnamtctl
Static hostname: ubuntu22
Icon name: computer
Machine ID: 8008a8c3071b4608b0cb5f05657b8715
Boot ID: 0a2b9153224a4ba5add8942b566658c6
Virtualization: oracle
Operating System: Ubuntu 22.10
Kernel: Linux 5.19.0-26-generic
Architecture: x86-64
Hardware Vendor: innotek GmbH
Hardware Model: VirtualBox
Firmware Version: VirtualBox

5. Using fetch tools

You must have heard about the fetch tools to show system information. For example, neofetch, screenfetch, etc.

However, you need to install it using the command line:

sudo apt install neofetch
sudo apt install screenfetch

After installation, you can run the command from the terminal.

Neofetch command to show Ubuntu version
Neofetch command to show the Ubuntu version

6. Using the GUI Settings window

You can open settings if you are running Ubuntu with a GNOME desktop. Then click on About. And you should find the Ubuntu version under the “OS Name” label.

Ubuntu version via settings
Ubuntu version via settings

Closing Notes

Although it is trivial, it can be overwhelming for absolute beginners to find out the Ubuntu version. Hence this article. I hope it helps everyone.

This article is part of the Linux command learning series.


Arindam

Creator and author of debugpoint.com. Connect with me via Telegram, 𝕏 (Twitter), or send us an email.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments