What command will tell me what version of Ubuntu I'm running?

3

1

I'm looking for a Unix/Linux command to determine what version of what distro I'm running.

Specifically, I want to be able distinguish between Ubuntu 9.04 and 9.10.

I was thinking something along the lines of uname -a, but that didn't work.

Ubuntu 9.04 gives:

Linux myhost 2.6.28-17-generic #58-Ubuntu SMP Tue Dec 1 21:27:25 UTC 2009 x86_64 GNU/Linux

Ubuntu 9.10 gives:

Linux myhost 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 17:01:44 UTC 2009 x86_64 GNU/Linux

Any suggestions?

therefromhere

Posted 2010-01-11T18:44:05.663

Reputation: 7 294

Answers

6

You can use this,

cat /etc/issue

or this,

cat /etc/lsb-release

The latter is probably better since it also gives the release name such as "karmic", etc. But it depends what you're using it for I guess.

Rich Adams

Posted 2010-01-11T18:44:05.663

Reputation: 542

1+1 /etc/issue works both on Debian and Ubuntu. – Johan – 2010-01-11T21:06:36.593

5

lsb_release also displays the version:

$ lsb_release -a 

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu feisty( development branch)

Release: 7.04

Codename: feisty

Sathyajith Bhat

Posted 2010-01-11T18:44:05.663

Reputation: 58 436