Sooner or later, every person who works with Ubuntu wonders – what version of Ubuntu do i have?
It is especially important to know the version of Ubuntu that you are running if you want to install some software and need to choose which version of Ubuntu the installer should be downloaded for.
From this short note you will learn how to get the complete information about the current version of Ubuntu from the command line.
Cool Tip: How to find an Ubuntu version the Linux Mint is based on! Read more →
Check Ubuntu Version
Run the following command to find Ubuntu version:
$ cat /etc/*[-_]{release,version}
No matter which version of Ubuntu or what GUI you are running – this command will always show the current Ubuntu version: its codename, release number and the Debian version on which your Ubuntu version is based:
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS" NAME="Ubuntu" VERSION="16.04.3 LTS (Xenial Xerus)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 16.04.3 LTS" VERSION_ID="16.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial stretch/sid
запросто можно и так