Find which Debian or ubuntu Linux Version you are running

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

20 thoughts on “Find which Debian or ubuntu Linux Version you are running

  1. Not sure if it always works, but Firefox’s default home page contains a welcome message with the version number.

  2. 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

  3. 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.

  4. If you just need the version number (for scripting, etc), you can do something like this:

    VERSION=`lsb_release -sd | cut -c 8-`
    echo Configuring for Ubuntu ${VERSION}…

  5. 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

  6. 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.

  7. My install does not have a debian_version file, OR a lsb_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.

  8. 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 ….

  9. 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)

Leave a comment

Your email address will not be published. Required fields are marked *