Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm starting to work with a box that has a custom (small) Linux build on it. How can I tell whether this is a Debian or Red Hat-based build?

This is what I know so far:

$ cat /proc/version
Linux version 2.6.31-2.5 (build@build-desktop) (gcc version 4.4.3 (Broadcom stbgcc-4.4.3-1.2) ) #7

$ apt-get
-sh: apt-get: command not found

$ yum
-sh: yum: command not found
share|improve this question

3 Answers 3

up vote 1 down vote accepted

Running uname -a should give you some general information about the system. Also, you can run apropos "package manager" or with similar keywords to hopefully find out more about the package manager. Look in /etc for a file named xyz-release where xyz should be whatever distro is running.

share|improve this answer
This is what I get when I run uname -a: $ uname -a Linux 2.6.31-2.5 #7 Thu Dec 15 19:57:09 CST 2011 mips GNU/Linux –  Sparky1 Jan 25 '12 at 17:40
@Sparky1 Then, it seems you have gotten yourself a Linux-MIPS distribution. –  user13742 Jan 25 '12 at 19:05

If it's an embedded device (e.g. a SoHo router), it probably won't be any of the "desktop/server" distros. I'd try to look into the device's manual, manufacturer's website (should have source to the GPL-licensed code), and the Web at large.

share|improve this answer

Check output of:

lsb_release -a


cat /etc/issue

You can also check for more low-lever package commands rpm for RedHat and dpkg for Debian.

share|improve this answer
$ dpkg command not found $ rpm (shows options for the rpm command). Looks like this a red hat based build. Thanks for the help! –  Sparky1 Jan 25 '12 at 17:43
you can also check /etc/debian_version file, which exists in all debian based linux distribution –  Coren Jan 25 '12 at 20:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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