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
Solution 1
cat /etc/issue
The file /etc/issue holds the version of Ubuntu installed on your system
Solution 2
lsb_release -a
or
cat /etc/lsb-release
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:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11
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
http://programs.rcrnet.net/#version
Thank you!
Exactly what I needed.
Don’t need to cut for ubuntu… just ‘lsb_release -sr’ does the trick.
on debian:
uname -a
debian version:
cat /etc/debian_version
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.
Example:
#! /bin/bash
source /etc/lsb-release
echo $DISTRIB_RELEASE
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_version
file, OR alsb_release
file in/etc
.The scripts fail. Even
uname -a
doesn’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.
Help?
Here’s the output to
uname -a
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’m stumped.
i want todays version of obuntu linux. i have seminar on obuntu linux so pls help me
@V
Per the Debian documentation, if the /etc/debian_version file does not exist, then it was not installed from official Debian installation disks.
http://www.debian.org/doc/FAQ/ch-software.en.html#s-isitdebian
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.
@V
uname -r
reveals the Linux kernel version.For example:
# uname -r
2.6.35-28-generic
Thankq for your information. its help full.
Why not look at /proc/version ?
On Ubuntu:
Linux version 2.6.24-27-server (buildd@palmer) (gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)) #1 SMP Wed Mar 24 10:39:18 UTC 2010
On Debian:
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.
Thank you!
You can use also cat /etc/os-release and number is in /etc/debian_version