Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you find the Ubuntu version (release number / name) from the command line?

share|improve this question
up vote 47 down vote accepted

Run lsb_release with the -a switch.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 9.04
Release:    9.04
Codename:   jaunty
share|improve this answer
    
That works on any LSB compliant distribution, right? I tried it on my debian 6 (squeeze) install, and it worked too. – Warren P Feb 6 '11 at 22:19
1  
Yes. The command 'lsb_release' is from the Linux Standards Base. From the man page; "The lsb_release command provides certain LSB (Linux Standard Base) and distribution-specific information." – jeremiah Apr 19 '11 at 20:33
$ cat /etc/issue
Ubuntu 8.10 \n \l
share|improve this answer
3  
It's worth remembering that /etc/issue may be edited by admins to give a different welcome message.. – Dentrasi Mar 12 '10 at 19:04
    
This is a useful fallback on non-LSB compliant systems. So is /etc/debian_version (if present), it's a debian based distro. I don't know if Ubuntu leaves the debian_version file there or makes an /etc/Ubuntu_version file though. – Warren P Feb 6 '11 at 22:20

source from /etc/lsb-release to export version information variables into your shell:

$ . /etc/lsb-release

Contains the following variables

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"
share|improve this answer

$ uname -a

Linux debian 2.7.30-1-686 #1 SMP Thu May 8 02:16:39 UTC 2008 i686 GNU/Linux


uname -a anaylsis:

Linux: is the kernel name.

debian: is the machine's hostname.

2.7.30-1-686: is the kernel version

1 SMP Thu May 8 02:16:39 UTC 2008: SMP stands for symmetric multiprocessing, denoting that the CPU (central processing unit) is using two or more CPUs and the current system date

i686: is the CPU architecture

GNU/Linux: is OS

share|improve this answer
7  
-1, uname doesn't tell you the ubuntu version. lsb_release is the way to go. – ThatGraemeGuy Sep 4 '09 at 4:20

You must log in to answer this question.

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