How do I check my Ubuntu Version?
There are two ways to check which version of Ubuntu you are running. You can either check from within Unity, or put in a short command line in the Terminal.
Option 1: Using lsb_release command
Below is easiest and fastest way for checking Ubuntu version through terminal is:
$ sudo apt-get update
$ sudo apt-get install lsb-release
$ sudo lsb_release -a
Output will be similar to below one:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
Some useful lsb_release
command hacks!
1. Use -r
for printing only release.
$ lsb_release -r
Output:
Release: 18.04
2. Use -s
with -r
for short printing.
$ lsb_release -r -s
Output:
18.04
3. Prining Codename using -c
.
lsb_release -c
Output:
Codename: bionic
4. Prining Description using -d
.
lsb_release -d
Output:
Description: Ubuntu 18.04.2 LTS
Option 2: Using lsb-release file
$ cat /etc/lsb-release
Output will be same as above.
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION=”Ubuntu 18.04.2 LTS”
Option 3: Using /etc/*release file
$ cat /etc/*release
You will output similar to below:
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION=”Ubuntu 18.04.2 LTS” NAME=”Ubuntu” VERSION=”18.04.2 LTS (Bionic Beaver)” ID=ubuntu ID_LIKE=debian PRETTY_NAME=”Ubuntu 18.04.2 LTS” VERSION_ID=”18.04” 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” VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic