1OS-RELEASE(5)                     os-release                     OS-RELEASE(5)
2
3
4

NAME

6       os-release - Operating system identification
7

SYNOPSIS

9       /etc/os-release
10
11       /usr/lib/os-release
12

DESCRIPTION

14       The /etc/os-release and /usr/lib/os-release files contain operating
15       system identification data.
16
17       The basic file format of os-release is a newline-separated list of
18       environment-like shell-compatible variable assignments. It is possible
19       to source the configuration from shell scripts, however, beyond mere
20       variable assignments, no shell features are supported (this means
21       variable expansion is explicitly not supported), allowing applications
22       to read the file without implementing a shell compatible execution
23       engine. Variable assignment values must be enclosed in double or single
24       quotes if they include spaces, semicolons or other special characters
25       outside of A-Z, a-z, 0-9. Shell special characters ("$", quotes,
26       backslash, backtick) must be escaped with backslashes, following shell
27       style. All strings should be in UTF-8 format, and non-printable
28       characters should not be used. It is not supported to concatenate
29       multiple individually quoted strings. Lines beginning with "#" shall be
30       ignored as comments.
31
32       The file /etc/os-release takes precedence over /usr/lib/os-release.
33       Applications should check for the former, and exclusively use its data
34       if it exists, and only fall back to /usr/lib/os-release if it is
35       missing. Applications should not read data from both files at the same
36       time.  /usr/lib/os-release is the recommended place to store OS release
37       information as part of vendor trees.  /etc/os-release should be a
38       relative symlink to /usr/lib/os-release, to provide compatibility with
39       applications only looking at /etc. A relative symlink instead of an
40       absolute symlink is necessary to avoid breaking the link in a chroot or
41       initrd environment such as dracut.
42
43       os-release contains data that is defined by the operating system vendor
44       and should generally not be changed by the administrator.
45
46       As this file only encodes names and identifiers it should not be
47       localized.
48
49       The /etc/os-release and /usr/lib/os-release files might be symlinks to
50       other files, but it is important that the file is available from
51       earliest boot on, and hence must be located on the root file system.
52
53       For a longer rationale for os-release please refer to the Announcement
54       of /etc/os-release[1].
55

OPTIONS

57       The following OS identifications parameters may be set using
58       os-release:
59
60       NAME=
61           A string identifying the operating system, without a version
62           component, and suitable for presentation to the user. If not set,
63           defaults to "NAME=Linux". Example: "NAME=Fedora" or "NAME="Debian
64           GNU/Linux"".
65
66       VERSION=
67           A string identifying the operating system version, excluding any OS
68           name information, possibly including a release code name, and
69           suitable for presentation to the user. This field is optional.
70           Example: "VERSION=17" or "VERSION="17 (Beefy Miracle)"".
71
72       ID=
73           A lower-case string (no spaces or other characters outside of 0-9,
74           a-z, ".", "_" and "-") identifying the operating system, excluding
75           any version information and suitable for processing by scripts or
76           usage in generated filenames. If not set, defaults to "ID=linux".
77           Example: "ID=fedora" or "ID=debian".
78
79       ID_LIKE=
80           A space-separated list of operating system identifiers in the same
81           syntax as the ID= setting. It should list identifiers of operating
82           systems that are closely related to the local operating system in
83           regards to packaging and programming interfaces, for example
84           listing one or more OS identifiers the local OS is a derivative
85           from. An OS should generally only list other OS identifiers it
86           itself is a derivative of, and not any OSes that are derived from
87           it, though symmetric relationships are possible. Build scripts and
88           similar should check this variable if they need to identify the
89           local operating system and the value of ID= is not recognized.
90           Operating systems should be listed in order of how closely the
91           local operating system relates to the listed ones, starting with
92           the closest. This field is optional. Example: for an operating
93           system with "ID=centos", an assignment of "ID_LIKE="rhel fedora""
94           would be appropriate. For an operating system with "ID=ubuntu", an
95           assignment of "ID_LIKE=debian" is appropriate.
96
97       VERSION_ID=
98           A lower-case string (mostly numeric, no spaces or other characters
99           outside of 0-9, a-z, ".", "_" and "-") identifying the operating
100           system version, excluding any OS name information or release code
101           name, and suitable for processing by scripts or usage in generated
102           filenames. This field is optional. Example: "VERSION_ID=17" or
103           "VERSION_ID=11.04".
104
105       PRETTY_NAME=
106           A pretty operating system name in a format suitable for
107           presentation to the user. May or may not contain a release code
108           name or OS version of some kind, as suitable. If not set, defaults
109           to "PRETTY_NAME="Linux"". Example: "PRETTY_NAME="Fedora 17 (Beefy
110           Miracle)"".
111
112       ANSI_COLOR=
113           A suggested presentation color when showing the OS name on the
114           console. This should be specified as string suitable for inclusion
115           in the ESC [ m ANSI/ECMA-48 escape code for setting graphical
116           rendition. This field is optional. Example: "ANSI_COLOR="0;31"" for
117           red, or "ANSI_COLOR="1;34"" for light blue.
118
119       CPE_NAME=
120           A CPE name for the operating system, following the Common Platform
121           Enumeration Specification[2] as proposed by the MITRE Corporation.
122           This field is optional. Example:
123           "CPE_NAME="cpe:/o:fedoraproject:fedora:17""
124
125       HOME_URL=, SUPPORT_URL=, BUG_REPORT_URL=, PRIVACY_POLICY_URL=
126           Links to resources on the Internet related the operating system.
127           HOME_URL= should refer to the homepage of the operating system, or
128           alternatively some homepage of the specific version of the
129           operating system.  SUPPORT_URL= should refer to the main support
130           page for the operating system, if there is any. This is primarily
131           intended for operating systems which vendors provide support for.
132           BUG_REPORT_URL= should refer to the main bug reporting page for the
133           operating system, if there is any. This is primarily intended for
134           operating systems that rely on community QA.  PRIVACY_POLICY_URL=
135           should refer to the main privacy policy page for the operation
136           system, if there is any. These settings are optional, and providing
137           only some of these settings is common. These URLs are intended to
138           be exposed in "About this system" UIs behind links with captions
139           such as "About this Operating System", "Obtain Support", "Report a
140           Bug", or "Privacy Policy". The values should be in RFC3986
141           format[3], and should be "http:" or "https:" URLs, and possibly
142           "mailto:" or "tel:". Only one URL shall be listed in each setting.
143           If multiple resources need to be referenced, it is recommended to
144           provide an online landing page linking all available resources.
145           Examples: "HOME_URL="https://fedoraproject.org/"" and
146           "BUG_REPORT_URL="https://bugzilla.redhat.com/""
147
148       BUILD_ID=
149           A string uniquely identifying the system image used as the origin
150           for a distribution (it is not updated with system updates). The
151           field can be identical between different VERSION_IDs as BUILD_ID is
152           an only a unique identifier to a specific version. Distributions
153           that release each update as a new version would only need to use
154           VERSION_ID as each build is already distinct based on the
155           VERSION_ID. This field is optional. Example:
156           "BUILD_ID="2013-03-20.3"" or "BUILD_ID=201303203".
157
158       VARIANT=
159           A string identifying a specific variant or edition of the operating
160           system suitable for presentation to the user. This field may be
161           used to inform the user that the configuration of this system is
162           subject to a specific divergent set of rules or default
163           configuration settings. This field is optional and may not be
164           implemented on all systems. Examples: "VARIANT="Server Edition"",
165           "VARIANT="Smart Refrigerator Edition"" Note: this field is for
166           display purposes only. The VARIANT_ID field should be used for
167           making programmatic decisions.
168
169       VARIANT_ID=
170           A lower-case string (no spaces or other characters outside of 0-9,
171           a-z, ".", "_" and "-"), identifying a specific variant or edition
172           of the operating system. This may be interpreted by other packages
173           in order to determine a divergent default configuration. This field
174           is optional and may not be implemented on all systems. Examples:
175           "VARIANT_ID=server", "VARIANT_ID=embedded"
176
177       If you are reading this file from C code or a shell script to determine
178       the OS or a specific version of it, use the ID and VERSION_ID fields,
179       possibly with ID_LIKE as fallback for ID. When looking for an OS
180       identification string for presentation to the user use the PRETTY_NAME
181       field.
182
183       Note that operating system vendors may choose not to provide version
184       information, for example to accommodate for rolling releases. In this
185       case, VERSION and VERSION_ID may be unset. Applications should not rely
186       on these fields to be set.
187
188       Operating system vendors may extend the file format and introduce new
189       fields. It is highly recommended to prefix new fields with an OS
190       specific name in order to avoid name clashes. Applications reading this
191       file must ignore unknown fields. Example:
192       "DEBIAN_BTS="debbugs://bugs.debian.org/""
193

EXAMPLE

195           NAME=Fedora
196           VERSION="17 (Beefy Miracle)"
197           ID=fedora
198           VERSION_ID=17
199           PRETTY_NAME="Fedora 17 (Beefy Miracle)"
200           ANSI_COLOR="0;34"
201           CPE_NAME="cpe:/o:fedoraproject:fedora:17"
202           HOME_URL="https://fedoraproject.org/"
203           BUG_REPORT_URL="https://bugzilla.redhat.com/"
204

SEE ALSO

206       systemd(1), lsb_release(1), hostname(5), machine-id(5), machine-info(5)
207

NOTES

209        1. Announcement of /etc/os-release
210           http://0pointer.de/blog/projects/os-release
211
212        2. Common Platform Enumeration Specification
213           https://cpe.mitre.org/specification/
214
215        3. RFC3986 format
216           https://tools.ietf.org/html/rfc3986
217
218
219
220systemd 219                                                      OS-RELEASE(5)
Impressum