Home

osrelease

Os-release, typically found at /etc/os-release, is a standardized, machine-readable file that provides operating system identification data for Unix-like systems. It is defined by the freedesktop.org OS Release specification and is widely used by Linux distributions to expose consistent metadata about the installed OS. Some distributions also ship a vendor-specific copy at /usr/lib/os-release, which may be used as defaults or overridden by /etc/os-release.

The file is a plain text collection of KEY=VALUE pairs. Values may be quoted, especially when they

Purpose and usage are central to os-release. It enables software to identify the operating system in a

Notes: while the spec aims for consistency, not all fields are present on every distribution, and implementations

contain
spaces.
The
most
common
keys
are
NAME,
VERSION,
ID,
ID_LIKE,
VERSION_ID,
and
PRETTY_NAME.
Additional
optional
keys
can
include
HOME_URL,
SUPPORT_URL,
BUG_REPORT_URL,
PRIVACY_POLICY_URL,
CPE_NAME,
and
variant-related
fields
such
as
VARIANT
and
VARIANT_ID.
The
ID
and
ID_LIKE
fields
help
describe
the
OS’s
identity
and
its
lineage
(for
example,
Debian-like
or
Red
Hat-like
distributions).
portable
way
without
distro-specific
parsing.
Tools
such
as
systemd
and
various
package
managers
rely
on
these
fields
to
tailor
behavior
or
display
appropriate
information.
In
shells,
a
common
pattern
is
to
source
the
file
to
populate
environment
variables
(for
example,
NAME,
ID,
VERSION_ID)
or
to
parse
a
specific
value
with
grep
or
awk.
may
vary.
In
container
images,
the
file
often
reflects
the
base
OS,
which
can
differ
from
the
host.
See
also
the
freedesktop.org
OS
Release
Specification
and
related
system
tooling.