In this tutorial, you’ll learn how to Check Ubuntu Version by using the command line or the Ubuntu Desktop GUI. There are several ways of checking your Ubuntu version and we cover all of them in this article.
Table of Contents
- Method 1 – The os-release File
- Method 2 – The lsb_release File
- Method 3 – The issue File
- Method 4 – The lsb_release Command
- Method 5 – The hostnamectl Command
- Method 5 – Check Ubuntu Version with GUI
- Summary
Method 1 – The os-release File
We can read the os-release
file located in /etc/
using the cat
command to find out which Ubuntu version we are running:
cat /etc/os-release
Code language: Bash (bash)
Output:
Method 2 – The lsb_release File
We can also read the lsb-release
file located in the /etc/
folder to check Ubuntu versions:
cat /etc/lsb-release
Code language: Bash (bash)
Output:
Method 3 – The issue File
Another file we can check to figure out which Ubuntu version we are running is the issue
file located in the /etc/
folder:
cat /etc/issue
Output:
Method 4 – The lsb_release Command
Another way is by using the built-in lsb_release
command:
lsb_release -a
Note: This might not work on WSL 2.
Output:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
Code language: plaintext (plaintext)
Less Information
You can also use the -d
flag to shorten the output:
lsb_release -d
Code language: Bash (bash)
Output:
Description: Ubuntu 20.04.4 LTS
Code language: plaintext (plaintext)
Method 5 – The hostnamectl Command
We can also use the hostnamectl
command to check our Ubuntu version:
hostnamectl
Code language: Bash (bash)
Note: This might not work on WSL 2.
Output:
Static hostname: ceos3c-ubuntu
Icon name: Virtual Machine
Chassis:
Machine ID:
Boot ID:
Operating System Ubuntu 20.04.4 LTS
Kernel:
Architecture: x86-64
Code language: CSS (css)
Method 5 – Check Ubuntu Version with GUI
If you are uncomfortable using the command line, you can also check your Ubuntu version inside of the Ubuntu GUI:
- Click on the Show Applications button in the lower-left corner.
- Click on Settings (type settings in the search bar if you can’t find it).
- Select About from the left navigation menu and scroll down until you find the OS Name field.
Summary
This is how easy it is to check Ubuntu versions. To summarize:
- You can read the
os_release
file. - You can read the
lsb_release
file. - You can read the
issue
file. - You can use the
lsb_release
command with either the-a
or the-d
flag. - You can use the
hostnamectl
command.
🐧 There are some related articles!
👉 Top Things to do after installing Kali Linux
👉 Linux on Windows – The Complete WSL 2 Tutorial Series
👉 Create Generalized Windows Images with FOG Server
👉 Install FOG Server on Ubuntu
👉 Install Kali Linux on Windows – Complete Guide
👉 The Complete Kali Linux and Windows Dual Booting Guide
👉 Cronjob – The Complete Guide to Cronjobs
👉 Open Bitlocker Drive on Linux – Quick & Easy