Comments on How To Know Which Linux Distribution You Are Using?

How To Know Which Linux Distribution You Are Using? Here are a few ways to find out which Linux distro you are using.

27 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: 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.

By: Anonymous

Look for


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

By: arun

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

By: 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?

By: amit

I completely agree with you

By: 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).

By: 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

By: 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 !!

By: 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

By:

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

"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) 

 

 

By: EvanCarroll

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

By: 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..

By: Anonymous

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


Fred

By: Anonymous

lsb_release -a

By: 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`


By: Anonymous

You can also do:

cat /etc/*-release

By: Anish Sneh

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

 

-- Anish Sneh

By: Anonymous

Debian squeeze: 

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

It seems that *release is distro specific

 

By: 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

By: Anonymous

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

By: Santiago

Hi dude.

 

You can execute the following in order to know exactly your version, among with another helpful information.

 

cat /etc/*-release

 

In my case returns:

 

DISTRIB_ID=Ubuntu

DISTRIB_RELEASE=14.04

DISTRIB_CODENAME=trusty

DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"

NAME="Ubuntu"

VERSION="14.04, Trusty Tahr"

ID=ubuntu

ID_LIKE=debian

PRETTY_NAME="Ubuntu 14.04 LTS"

VERSION_ID="14.04"

HOME_URL="http://www.ubuntu.com/"

SUPPORT_URL="http://help.ubuntu.com/"

BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

 

By: John

The "cat /ect/issue"  told me that my mint upgrade had been done successfully. Thanks I wasn't sure and it took a while. Upgraded from Linux Mint 17.3 Rosa to Linux Mint 18.1 Sarena or Sarah or something. Bunch of packages were transferred so I am sure there will be a few screw ups. But so far it looks pretty good.

By: cwb

The thing that works for me is:  

  $ cat /etc/issue

Linux Mint 18.2 Sonya \n \l

thanks!

By: Vivek

more /etc/redhat-release

By: John DeVito

How about uname -v | cut -d" " -f3

cat /etc/issue

By: Juan Manuel

Uups, I know my distro is Lubuntu, but i may no see that name in any option, how may i get that name? or why is not identified like that?

(I had to use "dmesg | head -2", first line was an update message: [    0.000000] microcode: microcode updated early to revision 0xa0b, date = 2010-09-28)