On what Linux distributions can I rely on the presence of /etc/os-release?
28
votes
2
answers
12482
views
I'm trying to find a way to determine Linux distribution name and version that would work on most (or ideally, all) modern distributions. I noticed that
/etc/os-release
contains the info I need on the distributions I tried (CentOS, Debian), but how safe is it to rely on the presence of it? Commands such as uname -a
don't really contain the same info, and lsb_release
is apparently not present on e.g. minimal CentOS.
Is there a quick way to find out exactly what distros come with /etc/os-release
? Moreover, is /etc/os-release
guaranteed to contain NAME
, VERSION
and PRETTY_NAME
fields?
Asked by w128
(383 rep)
Mar 15, 2017, 09:17 AM
Last activity: May 29, 2024, 04:24 PM
Last activity: May 29, 2024, 04:24 PM