Timeline for How can I reliably get the operating system's name?
Current License: CC BY-SA 3.0
33 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 23, 2019 at 16:18 | comment | added | Jeff Learman | The best source I've found is the text file /proc/version. Unfortunately the results aren't easily parsed to provide a clear distro name (which is also true of the '/etc' files). /proc/version was available in every case I've tried, which is not true of any /etc files. | |
| Jan 6, 2017 at 14:37 | comment | added | KJH | Amazon Linux uses /etc/system-release. It also has the multi-line /etc/os-release with more details, as well as /etc/issue. | |
| Jul 5, 2016 at 5:57 | comment | added | Jander | I'm torn. On the one hand, I love this answer for its amazing detail. On the other, it's really hard to notice that it's about anything besides LSB, to the point where there's hestiation to call (e.g.) unix.stackexchange.com/q/293898/3629 a duplicate question. With a little reorganization I think it could be a great canonical answer to the question. | |
| S Mar 7, 2015 at 6:41 | history | suggested | Sildoreth | CC BY-SA 3.0 | Fixed broken link; fixed grammar |
| Mar 7, 2015 at 5:47 | review | Suggested edits | |||
| S Mar 7, 2015 at 6:41 | |||||
| Oct 1, 2013 at 15:23 | comment | added | slm♦ | @Nils - Rob responded, I've added the email exchange to my answer. LMK you thoughts. | |
| Oct 1, 2013 at 15:23 | history | edited | slm♦ | CC BY-SA 3.0 | added 2456 characters in body |
| Oct 1, 2013 at 13:53 | comment | added | slm♦ | @Nils - yeah I figured it was a starting point. | |
| Oct 1, 2013 at 13:43 | comment | added | Nils | SLES is not OpenSuSE - so this might be intentional (but not good for profit either). | |
| Oct 1, 2013 at 13:32 | comment | added | slm♦ | @Nils - sent an email to the board member that claims to be on the LSB working group, see what he says on the matter. | |
| Oct 1, 2013 at 13:24 | comment | added | slm♦ | @Nils - I also find it odd that one of the board members of OpenSuSE is part of the LSB working group. I might drop them a n email to see it was intentional or otherwise. | |
| Oct 1, 2013 at 13:21 | comment | added | Nils | Yes - this seems to contradict the goals of the lsb-project. So if SuSE is member of that project someone should stamp on their feet. | |
| Oct 1, 2013 at 13:11 | comment | added | slm♦ | @Nils - that very much surprises me. I would expect a venerable package like this to be included. I wonder if it's a SLES vs. SLED type of an issue? I would still hold that this package should've been included with SLES and that it missing is an oversight. I've worked with CAD vendors in the past (Mentor, Synospsy, etc.) and that package was used for a variety of the installers as well as wrapper scripts that would check for the type of box, prior to running. We used this software on RH primarily but there were instances of SuSE (old versions by today's standards). | |
| Oct 1, 2013 at 13:04 | comment | added | Nils | I just checked our default-autoyast-profile for SLES: we did not exclude lsb or lsb_release. The base-pattern includes minimal+X11+base so this does not seem to include those packages. I would call this a enterprise server policy. If someone likes to, he/she can include these packages by default, but you can not gurantee that they exist unless you are in power to do so. | |
| Sep 30, 2013 at 12:12 | comment | added | slm♦ | @Nils - I disagree, that's more a matter of who setup the system. Most enterprise + corporate servers/desktops would be deployed with this package installed and others. | |
| Sep 30, 2013 at 11:50 | comment | added | Nils | lsb_release is part of the lsb-release rpm in SLES11. It is not installed by default - so it will only work if installed. So not reliable for all Linuxes. | |
| Sep 29, 2013 at 21:26 | comment | added | slm♦ | @Nils - which postings? When I googled I found several that showed lsb_release output on SLES. | |
| Sep 29, 2013 at 21:11 | comment | added | Nils | @slm Interesting. I will check this. Possibly it is not installed by default (which seems to be strange). Other postings also show versions of SLES where it did not work. | |
| Sep 29, 2013 at 13:08 | comment | added | terdon♦ | @sterz what makes you think it's buggy? That's normal output. | |
| Sep 27, 2013 at 10:45 | comment | added | slm♦ | @Nils - I don't think it's installed, this blog post clearly shows someone running it on SLES11, dizwell.com/2011/03/15/peas-n-pods (in comments). | |
| Sep 27, 2013 at 10:40 | comment | added | slm♦ | @Nils - is it installed? I think the package is lsb. linux.derkeiler.com/Mailing-Lists/SuSE/2008-07/msg02304.html | |
| Sep 27, 2013 at 10:30 | comment | added | Nils | lsb_release is not available on SLES11. | |
| Sep 26, 2013 at 12:31 | comment | added | slm♦ | @elmo - Yeah SunOS is different than Solaris, SunOS predates Solaris so I'm inclined to think you mean Solaris. The numbers are typically 2.9, 2.10, 2.11, people typically drop the 2., and simply call it 10. My point is that Python can be installed but in hardened production systems often times isn't for a variety of reasons. Though true it can be installed, when shipping software one can't guarantee that it will be there, and asking customers to install Python is one more requirement that you can save them. | |
| Sep 26, 2013 at 10:49 | comment | added | elmo | @slm: I have access to machine with SunOS 5.10 (which I assume is 10 in your list - I am not that familiar with version numbers/conventions of Sun) and it does have a Python. I have access to machine with AIX 7 and it does have Python. Linux machines obviously have it also. So still Python looks like most portable choice. As for Sun below 10 I am not sure why it wouldn't allow Python to be installed (admittedly current install is lacking i.e. ncurses and ctypes, so who knows). As for Python using LSB it is not surprising at all for Linux if it is default approach. | |
| Sep 25, 2013 at 9:34 | comment | added | slm♦ | @elmo - look at the code behind that function, hg.python.org/cpython/file/2.7/Lib/platform.py#l259. Big surprise it's using LSB! | |
| Sep 25, 2013 at 9:31 | comment | added | slm♦ | @elmo - gcc though, an option, doesn't appear to be that appealing to me either. It seems wrought with too many problems, I was demonstrating it merely as an option. | |
| Sep 25, 2013 at 9:29 | comment | added | slm♦ | @elmo - yes LSB is Linux Standard Base, so I wouldn't expect either AIX or SunOS to have it. My experience with SunOS is 15+ years, and the majority of vendors whose software I dealt with would usually provide there own shell script similar to the ones I referenced above. Until Solaris 11, Python was not an option. And this is what makes it a difficult nut to crack. If you provide software that needs to run on Solaris 9, 10, 11, AIX, and a couple of Linux distros (SUSE, Ubntu, and RHEL) what do you do? Python is not an option, so you're left with a hand coded shell script. | |
| Sep 25, 2013 at 9:16 | comment | added | elmo | Note: Just did a quick check on machines with AIX and SunOS. They don't seem to have lsb_release installed (and after all, this is Unix not Linux stack). Problem with gcc is that some ppl now start using clang. Also you can never be sure which gcc was used to build (on systems I work with there are at least few versions on each). So my vote goes to Python solution as it seems to be installed now everywhere by default. | |
| Sep 25, 2013 at 4:47 | history | edited | slm♦ | CC BY-SA 3.0 | deleted 1547 characters in body |
| Sep 25, 2013 at 1:36 | vote | accept | terdon♦ | ||
| Sep 24, 2013 at 20:26 | history | edited | slm♦ | CC BY-SA 3.0 | added 193 characters in body |
| Sep 24, 2013 at 20:13 | history | edited | slm♦ | CC BY-SA 3.0 | added 193 characters in body |
| Sep 24, 2013 at 20:08 | history | answered | slm♦ | CC BY-SA 3.0 |