Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
add comment

3 Answers

up vote 35 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
    
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
add comment
$ cat /etc/issue
Ubuntu 8.10 \n \l
share|improve this answer
2  
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
add comment

$ 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
5  
-1, uname doesn't tell you the ubuntu version. lsb_release is the way to go. –  ThatGraemeGuy Sep 4 '09 at 4:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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