dmlb2000
February 2nd, 2010, 07:31 AM
I was wondering how to detect ubuntu is the OS environment I am running in and what version is it (numeric and by name if possible).
So in RedHat based systems usually the standard is to parse out /etc/redhat-release and for debian they have /etc/debian_version and ubuntu systems have /etc/debian_version but it doesn't reflect the ubuntu version of the system.
Is there a dpkg-* command I can use to get if I'm ubuntu or debian? is there a file I can read to determine what version of ubuntu I'm in?
I'd like to be able to do this for debugging purposed of the application that way I know exactly what environment to setup for the application to start debugging.
I was trying to look through how ubuntu-bug pulls the version information but I'm not sure its actually pulling the version from the OS.
So in RedHat based systems usually the standard is to parse out /etc/redhat-release and for debian they have /etc/debian_version and ubuntu systems have /etc/debian_version but it doesn't reflect the ubuntu version of the system.
Is there a dpkg-* command I can use to get if I'm ubuntu or debian? is there a file I can read to determine what version of ubuntu I'm in?
I'd like to be able to do this for debugging purposed of the application that way I know exactly what environment to setup for the application to start debugging.
I was trying to look through how ubuntu-bug pulls the version information but I'm not sure its actually pulling the version from the OS.