There are times debian or ubuntu users and admins want to find which version of debian and ubuntu linux version is running on their machines.This is very useful for those who is helping their customers and they want to know which version they are running and if you took over new system admin job you want to know which version is running on your servers or desktops.
Find or identify which version of Debian Linux you are running
This can be checked in /etc/debian_version file
Find or identify which version of ubuntu Linux you are running
You can find in different ways in ubuntu
The file /etc/issue holds the version of Ubuntu installed on your system
Not sure if it always works, but Firefox’s default home page contains a welcome message with the version number.
Firefox’s About dialog also contains the operating system:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:22.214.171.124) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/126.96.36.199
I’ve found much better the firefox way rather than the console one.
While the /etc/debian_version file just says : “testing/unstable”
the other one gives me a lot of info about my OS.
If you just need the version number (for scripting, etc), you can do something like this:
Or you could run this
Exactly what I needed.
Don’t need to cut for ubuntu… just ‘lsb_release -sr’ does the trick.
For scripting a quick and easy way would be to source /etc/lsb-release. This will make all the variables in /etc/lsb-release available to the script.
As checked today, “/etc/debian_version” contains the version number.
I think you didn’t read the post correctly. Don’t use “/etc/debian_version” to know your Ubuntu version.
On Lenny, this file contains: 5.0.6
and on Ubuntu 10.04.1 this file is filled with “squeeze/sid”, which is correct because Ubuntu is built on Debian Testing.
Good point BiSScuiTT. I think the lsb_release script just reads that so sourcing this is the best way to do it.
My install does not have a
debian_versionfile, OR a
The scripts fail. Even
uname -adoesn’t tell me which version of Debian Linux I am running… it just tells me what my KDE version is, plus letting me know as an aside that I’m running Linux.
I swear to you it is a Lenny Debian distro of the linux operating system. I know it’s 5.*.* but that’s about it.
I vaguely remember that aptitude has some kind of clever trick for finding out what version of linux you are running, but I checked the aptitude help files and no dice.
Here’s the output to
Linux mcgee 2.6.26-2-686 #1 SMP Thu Sep 16 19:35:51 UTC 2010i686 GNU/Linux
I know that I’m not running Debian version 2.6.26. That’s absurd. Besides, I’ve done this before, (used uname) and it’s even told me that it’s Lenny and everything.
i want todays version of obuntu linux. i have seminar on obuntu linux so pls help me
Per the Debian documentation, if the /etc/debian_version file does not exist, then it was not installed from official Debian installation disks.
However, any of the LSB files should be there as LSB is Linux Standard Base. If for some reason you find yourself without it (i guess it could happen, in Lenny? i doubt it…) , install the package.
uname -rreveals the Linux kernel version.
# uname -r
Thankq for your information. its help full.
Why not look at /proc/version ?
Linux version 2.6.24-27-server ([email protected]) (gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)) #1 SMP Wed Mar 24 10:39:18 UTC 2010
Linux version 2.6.26-2-686 (Debian 2.6.26-15) ([email protected]) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Thu Mar 26 01:08:11 UTC 2009
That should be a reliable way of finding out ….
on debian wheezy i type in the console: lsb_release -d
i still dont know how to check the version (6.0.3 or something like that)
the cmd lsb_release -a ,for unbutu is useful.
You can use also cat /etc/os-release and number is in /etc/debian_version