Showing posts with label os. Show all posts
Showing posts with label os. Show all posts

Monday, September 8, 2008

Determining Linux Version

Linux distributions don't tend to standardize where they store information about what release is installed. Going further, there's not even a standard way to detect what distribution is installed. If a system is running a popular distro, this information can usually be found in one of the following files:


Debian /etc/debian_release, /etc/debian_version,
Fedora /etc/fedora-release
Gentoo /etc/gentoo-release
Mandrake /etc/mandrake-release
Novell SUSE /etc/SUSE-release
Red Hat /etc/redhat-release, /etc/redhat_version
Slackware /etc/slackware-release, /etc/slackware-version
Solaris/Sparc /etc/release
Sun JDS /etc/sun-release
Ubuntu /etc/lsb-release
UnitedLinux /etc/UnitedLinux-release
Yellow dog /etc/yellowdog-release


You can find more information on this problem as well as a shell script to assist with OS detection here. An even larger master list can be found here.