tyme Posted January 6, 2003 Report Share Posted January 6, 2003 what's the best way to determine the distribution of a linux system? i'm posting the question in this forum because i need to be able to do it in a bash script. while i'm at it, what's the easiest way to determine a version of a specific service? I.E. statd, mountd, and the like. (or any program for that matter) assume that RPMs may or may not be the process by which the programs where installed. thanks for any help :) Quote Link to comment Share on other sites More sharing options...
paul Posted January 6, 2003 Report Share Posted January 6, 2003 what's the best way to determine the distribution of a linux system? cat /proc/version or uname -a Quote Link to comment Share on other sites More sharing options...
tyme Posted January 6, 2003 Author Report Share Posted January 6, 2003 uname -a last time i tried uname -a it didn't give the distribution name...maybe i'm not looking at it right...i'll try the cat /proc/version tho, thanks! Quote Link to comment Share on other sites More sharing options...
aru Posted January 6, 2003 Report Share Posted January 6, 2003 if you want the distribution name (or release name) on a mandrake then: [arusabal@localhost ~]$ cat /etc/mandrake-release Mandrake Linux release 8.1 (Vitamin) para XXXX (i586) or simply do 'cat /etc/issue' In both cases you'll get the name of the mandrake release, which is pretty useless. What is important is what paul said ('/proc/version' or 'uname') because there you'll get the kernel version, the compiler used... which is what really matters. I don't think there is a standard file where to put the name of a distro (even there is no need to do it at all). That just depends on the people who made the distro (IMHO). while i'm at it, what's the easiest way to determine a version of a specific service? I.E. statd, mountd, and the like. (or any program for that matter) Looking at the man page of each command/program/daemon, you can check which parameter is used to return the version of the program (usually -v or -V). other useful hints are: rpm -qa | grep package_name Will let you know the rpm version of the package (which is normaly related to the version of the software it provides). To get a deeper detailed info, do: rpm -qi package_name Quote Link to comment Share on other sites More sharing options...
tyme Posted January 7, 2003 Author Report Share Posted January 7, 2003 In both cases you'll get the name of the mandrake release, which is pretty useless. What is important is what paul said ('/proc/version' or 'uname') because there you'll get the kernel version, the compiler used... which is what really matters. i'm actually going to be looking for what distribution of Linux it is, Red Hat, Mandrake, etc. and what version of that distro it is. this is all tied into bash scripts that are going to be used for checking for programs w/security holes. but, i got all the info i need at this point, so thanks! Quote Link to comment Share on other sites More sharing options...
aru Posted January 9, 2003 Report Share Posted January 9, 2003 I don't know if you already know this, but as it has been my last bash-discovery, here it goes: ---> at least this works for bash: In my Mdk box: [arusabal@mdkhost ~]$ echo $MACHTYPE i586-mandrake-linux-gnu and in my Slackware box: [arusabal@slackhost ~]$ echo $MACHTYPE i386-slackware-linux-gnu ... now I have to find out where does bash get that info... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.