Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

We have some new hardware in our office which runs its own customized Linux OS.

How do I go about figuring which distro it's based on?

share|improve this question

marked as duplicate by Mikel, Joseph R., manatwork, Anthon, Thomas Nyman Oct 13 '13 at 16:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 38 down vote accepted

A question very close to this one was posted on Unix.Stackexchange HERE Giles has a pretty complete | cool answer for the ways he describes.

# cat /proc/version

Linux version 2.6.32-71.el6.x86_64 (mockbuild@c6b6.centos.org) (gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) ) #1 SMP Fri May 20 03:51:51 BST 2011  
# uname -a

Linux system1.doofus.local 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST 2011 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/issue

CentOS Linux release 6.0 (Final)
Kernel \r on an \m

cat /proc/config.gz cat /usr/src/linux/config.gz cat /boot/config*

Though I did some checking and this was not very reliable except on SUSE.

# zcat /proc/config.gz | grep -i kernel

Release Files in /etc (from Unix.com)

  • Novell SuSE---> /etc/SuSE-release
  • Red Hat--->/etc/redhat-release, /etc/redhat_version
  • Fedora-->/etc/fedora-release
  • Slackware--->/etc/slackware-release, /etc/slackware-version
  • Old Debian--->/etc/debian_release, /etc/debian_version
  • New Debian--->/etc/os-release
  • Mandrake--->/etc/mandrake-release
  • Yellow dog-->/etc/yellowdog-release
  • Sun JDS--->/etc/sun-release
  • Solaris/Sparc--->/etc/release
  • Gentoo--->/etc/gentoo-release

There is also a bash script at the Unix.com link someone wrote to automate checking.

Figuring out what package manager you have is a good clue.

rpm yum apt-get zypper +many more

Though this is by no means foolproof as the vendor could use anything they want. It really just gives you a place to start.

# dmesg | less

Linux version (geeko@buildhost) (gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) ) #1 SMP 2010-05-20 11:14:20 +0200

pretty much the same information as cat /proc/version & uname

share|improve this answer
If you are in a container, beware cat /proc/version will give the host distro, not the container one. – Dereckson Mar 24 '15 at 20:10

As a first guess, try lsb_release -a. E.g. on an Arch Linux system it gives

LSB Version: n/a
Distributor ID: archlinux
Description: Arch Linux
Release: rolling
Codename: n/a

However, this might fail, then you will have to poke around /etc (most likely it is inside a file whose name ends with -release). Also cat /etc/issue might help.

share|improve this answer
lsb_release -a returns "-bash: lsb_release: command not found" on Raspberry with Raspbian (Debian 7.1 derived). – Peter Mortensen Jun 5 '14 at 11:30

You'll want to use:

$ cat /etc/*-release

You'll get a response similar to this:

$ cat /etc/*-release

Also going to echo another poster's suggestion too (it will pull a bit more detailed information):

$ cat /proc/version
Linux version 3.0.0-14-server (buildd@allspice) (gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #23-Ubuntu SMP Mon Nov 21 20:49:05 UTC 2011
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.