Jason Sares is a Giant Dork

Linux Quick Tip – Find What Distro You’re On

I was just setting up some services on the giantdorks server and I forgot which distro (doh) we’re running. uname -a wasn’t very helpful so I looked at /etc/issue and found it was openSUSE 10.2 (i586). Anyone know which distros this works for, or any other ways to find which distro you’re logged on to?

Edit:

I found an additional way is to use lsb_ release -a

Posted in Linux Quick Tip | 4 comments

4 Comments so far

  1. alain December 5th, 2007 6:41 pm

    This also works..

    openSUSE: cat /etc/SuSE-release
    Debian: cat /etc/debian_version

  2. jason December 6th, 2007 3:57 pm

    Hey Alain that will give you the version you’re on but how would you know what distro you’re on?

  3. Alain Kelder December 7th, 2007 11:59 am

    Yeah, doesn’t seem like there’s a standard method that works across all Linux distributions. Found this list on the webmasterworld forum:

    Novell SuSE
    /etc/SuSE-release

    Red Hat
    /etc/redhat-release, /etc/redhat_version

    Fedora
    /etc/fedora-release

    Slackware
    /etc/slackware-release, /etc/slackware-version

    Debian
    /etc/debian_release, /etc/debian_version,

    Mandrake
    /etc/mandrake-release

    Yellow dog
    /etc/yellowdog-release

    Sun JDS
    /etc/sun-release

    Solaris/Sparc
    /etc/release

    Gentoo
    /etc/gentoo-release

  4. Alain Kelder December 7th, 2007 12:05 pm

    BTW, ‘lsb_release’ didn’t work for me on Debian 4.0 (Etch)