110

What terminal command tells the version of Ubuntu.

3
  • @fossfreedom this question is not a duplicate of the question you linked because i am asking how to check using terminal, not the graphical way. remove your concern Jul 2, 2014 at 4:39
  • 1
    The duplicate covers both terminal and graphical. IMHO they are the same question. These probably should be merged. I'll ask some 20K users before making that decision.
    – fossfreedom
    Jul 2, 2014 at 6:02
  • 2
    the duplicate does but the question doesnt. when others search for a terminal command and they find the other question, they wount look into it because it doesnt say anything about it in the question description Jul 2, 2014 at 21:03

2 Answers 2

140

For the description and the release number including the OS name, run:

$ lsb_release -d
Description:    Ubuntu 12.04 LTS

Just for the the codename, use:

$ lsb_release -c
Codebase:   precise

For the release number only, use:

$ lsb_release -r
Release:    12.04

For all lsb version details, use:

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 12.04 LTS
Release:    12.04
Codename:   precise
2
  • 5
    That gives the codename. for the description including the OS name ("Ubuntu" on an Ubuntu system) and the release number, use lsb_release -d. For the release number only, use lsb_release -r. For all available lsb information, use lsb_release -a. Jun 14, 2012 at 19:30
  • Note on 16.04 there it does not work. Getting message instead "No LSB modules are available."
    – Marcin
    May 5, 2016 at 5:22
79

This should give you what you want:

cat /etc/lsb-release
4
  • Using lsb_releasejust gives me "No LSB modules are available". This does the trick.
    – eis
    Dec 29, 2015 at 16:09
  • Use lsb_release -ra May 2, 2016 at 8:36
  • Works on 16.04 unlike lsb_release.
    – Marcin
    May 5, 2016 at 5:22
  • Fiddling around with Ubuntu via Docker, and this command works if you're using the 16.04 version and later and 12.04. The one in the accepted answer works for the 14.04 release.
    – MattD
    Feb 26, 2017 at 5:00

Not the answer you're looking for? Browse other questions tagged .