Identifying Linux distribution
Sometimes I come across a Linux install and don't know what distribution runs on it. This page documents the markers I found that permit identification of distribution including its version.
RPM based distributions
These can typically be identified by the presence of "rpm" command. Most systems will have rpm or apt installed, but not both.
Fedora, RHEL and Centos distributions along with their versions
can be quickly gleaned from the output of
- Fedora installations will have many packages with
.fcXX.in their name, where XX is a number like 20 signifying Fedora release.
- RHEL and Centos installations will have many packages with
.elXsuffix, where X is a number like 5 signifying the major version of the release.
- Centos will have packages with
.centosin their names, whereas RHEL is unlikely to have any such packages.
Debian and derivative distributions
These can typically be identified by the presence of "apt" and "dpkg" commands.
Debian and Debian derivatives have a
Stable Debian releases have the release version number in it, like
Systems running the testing distribution will show the
code name of the distribution, like
Ubuntu is apparently built from Debian testing, thus it has
the Debian release it was built from, like
jessie/sid, in its
/etc/debian_version file. Ubuntu can be easily identified by
ubuntu in package versions obtained from
can be identified
lsb_release -a, or checking
/etc/lsb-release which has
the same information.
lsb_release -a works on Debian as well but the corresponding file
Another technique that works on Debian and Ubuntu,
per this page,