How To Know Which Linux Distribution You Are Using? 

Here are a few ways to find out which linux distro you are using :

  • From the Boot Time messages
    Fire up your favourite terminal program and type in the following

    dmesg | head -1


    The output would be similar to

    Linux version 2.6.13-15-default (geeko@buildhost) (gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)) #1 Tue Sep 13 14:56:15 UTC 2005

  • Using /proc/version
    In the terminal type

    cat /proc/version


    The output would be like


    Linux version 2.6.13-15-default (geeko@buildhost) (gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)) #1 Tue Sep 13 14:56:15 UTC 2005

  • Using /etc/issue
    This method gives the most appropriate answer

    cat /etc/issue


    The output should be like

    Welcome to SUSE LINUX 10.0 (i586) - Kernel \r (\l).

P.S : You may try this shell script to know about your Linux Distribution. The original source is here
Share this page:

20 Comment(s)

Add comment

Comments

From: Anonymous

You might want to try
cat /etc/slackware-version

None of the methods you listed work on my distro - of course I'm running my own kernel.

From: Anonymous

Look for


/etc/SuSE-release
/etc/redhat-release
/etc/debian_version

From: arun

thanks, i added this info as a shell script in the article :)

From: Anonymous

It really is utterly daft that there is no standard way of doing this. The fact that such a long page exists on this topic is itself disappointing.  We need something like

uname -distro

Or  would that be too sensible?

From: amit

I completely agree with you

From: QBall

OR better yet, just:

[username@localhost ~]$ distro

 or

[username@localhost ~]$ distro -[option]

with options like: -kernel-name, - kernel-release, -kernel-version, -machine, -processor, hardware-platform, -operating-system, -distrib-id, etcetera

Plus any other info that would be helpful (got OPTIONs from uname --help).

From: Anonymous

Another command to find out your Kernel Version and what box you're on ;-)

uname -a

Will show you:

Linux myhost.mydomain.tld 2.6.8-2-686-smp #1 SMP Tue Aug 16 12:08:30 UTC 2005 i686 GNU/Linux

From: arun

Another command to find out your Kernel Version and what box you're on ;-)

uname -a

Will show you:

Linux myhost.mydomain.tld 2.6.8-2-686-smp #1 SMP Tue Aug 16 12:08:30 UTC 2005 i686 GNU/Linux

But it won't show you which linux distribution you are using !!

From: Anonymous

Actually, methods one and two are the same, since both return the kernel identification string. Both of these will not work on distributions which do not put their name into the kernel ID (such as AFAIR slackware) or on systems with a custom kernel.

Method 3 is completely ridiculous, since almost nobody pays attention to issue file nowadays. My gentoo box returns:

# cat /etc/issue
This is \n.\O (\s \m \r) \t

From:

================== 

"Method 3 is completely ridiculous, since almost nobody pays attention to issue file nowadays. My gentoo box returns:

"# cat /etc/issue
This is \n.\O (\s \m \r) \t"

================= 

 It's not ridiculous if it works and it works for me.  So give it a try.  It may work for you, too:

#cat /etc/issue

Red Hat Enterprise Linux ES release 4 (Nahant Update 5) 

 

 

From: EvanCarroll

egrep '^[^#]*title' /boot/grub/menu.lst | grep -v 'memtest'

From: arun

I think you've to use that as superuser sudo egrep '^[^#]*title' /boot/grub/menu.lst | grep -v 'memtest' should do the work ;-) It won't work if you are using Lilo..

From: Anonymous

I have also created a tool called osinfo to report your distrib. More info here.


Fred

From: Anonymous

lsb_release -a

From: Anonymous

The /etc/issue file should not be trusted, the file is intended as a text message to be displayed before login for telnet, or after the username has been entered with SSH. The issue file was never intended for storing a distribution version, the fact most distros put something there is merely coincidental branding (coz it's nice to have something in there)

 A better indicator of the distribution is to `echo /etc/*release`


From: Anonymous

You can also do:

cat /etc/*-release

From: Anish Sneh

Thanks mate "cat /etc/*-release", gave the most appropriate one :)

 

-- Anish Sneh

From: Anonymous

Debian squeeze: 

#  cat /etc/*-release
cat: /etc/*-release: No such file or directory

It seems that *release is distro specific

 

From: Anonymous

vm-105:~# cat /etc/issue
Debian GNU/Linux 6.0 \n \l

but

vm-105:~# cat /proc/version
Linux version 2.6.18-xen ([email protected]) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-8)) #2 SMP Wed Apr 16 12:47:36 CDT 2008
 

So, it's a debian with a red hat kernel?

I'm confused,

 M

From: Anonymous

There seems to be some sort of standard /etc/os-release thing. It at least exists on Ubuntu and Arch.