check ubuntu version

Ubuntu’s current long-term support release is Ubuntu 22.04 LTS (Jammy JellyFish) while the latest interim release is Ubuntu 22.10 (Kinetic Kudu). The next interim release, Ubuntu 23.04 (Lunar Lobster), is almost here.

Users running the LTS release likely won’t be in a hurry to upgrade, whereas interim users prefer keeping up with the latest version. If you’re curious about whether you should update or not, your first step should be to check your current Ubuntu version.  

Lsb_release

The standard way to check the OS version is by querying the /etc/lsb-release file. We’ll first do this with the lsb_release command.

lsb_release -a

In our case, the release version is 22.04 (codenamed jammy). The .2 at the end means that this is the second updated version of jammy which includes various bug fixes compared to the original release. 

Alternatively, you can also use cat to print the contents of the lsb-release file.

cat /etc/lsb-release

If you want to extract the version info only, you can use

grep DISTRIB_DESCRIPTION /etc/lsb-release | cut -d "=" -f 2-

Aside from this, you can also query the /etc/os-release or /etc/issue files to get the version info.

cat /etc/os-release | awk -F= '/^VERSION=/ {print $2}' /etc/os-release | sed 's/"//g'
cat /etc/issue

Hostnamectl

Hostnamectl is used to query and change the hostname and related settings. When no command is specified, it returns the output of hostnamectl status.  

hostnamectl

Aside from the OS version, it’ll also display other useful information such as the hostname, kernel version, and hardware model. If you don’t need the extra info and only want the version, you can instead use

hostnamectl | grep 'Operating System' | awk '{print $3,$4,$5}'

Settings

You can also check the OS version and related system information from the Settings app.

  1. Search and open the ‘About’ page from the Applications screen.
    ubuntu about system information
  2. Check the OS Name field here.
    ubuntu settings os name version
Anup Thapa

Senior Writer

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys reading up on a range of topics, traveling, working out, and MOBAs.