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

link|improve this question
feedback

3 Answers

up vote 25 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
link|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
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
feedback
$ cat /etc/issue
Ubuntu 8.10 \n \l
link|improve this answer
1  
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
feedback

$ 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

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

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.