[wplug] Determining distro version (was: weird rsync error)

Vance Kochenderfer vkochend at nyx.net
Fri Mar 21 18:29:13 EST 2008


Patrick Wagstrom <patrick at wagstrom.net> wrote:
> 
> > A command like "/sbin/wtflinuxflavor" would be really nice, all it
> > needs to do is "echo You're running XXX" or
> > "printf You're running ZZZ"
> 
> you mean something complicated like:
> cat /etc/issue

This generally works, though if someone has changed the login
banner it won't help.  You can also look for a file
"/etc/*release" (e.g., /etc/redhat-release, /etc/debian-release),
but I don't know if Ubuntu has that.  Of course uname gives the
kernel version but doesn't tell you anything about userland.

There is an "lsb_release" command that should be present on all
LSB-compliant distros and gives output in a standardized format.
Other than that, there's no real consistent way to find out the
distro version, though in theory it shouldn't matter so much since
installers are supposed to check dependency versions individually.

Vance Kochenderfer        |  "Get me out of these ropes and into a
vkochend at nyx.net          |   good belt of Scotch"    -Nick Danger


More information about the wplug mailing list