1OS-RELEASE(5) os-release OS-RELEASE(5)
2
3
4
6 os-release - Operating system identification
7
9 /etc/os-release
10
11 /usr/lib/os-release
12
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. Blank lines are permitted and ignored.
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
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_CODENAME=
98 A lower-case string (no spaces or other characters outside of 0–9,
99 a–z, ".", "_" and "-") identifying the operating system release
100 code name, excluding any OS name information or release version,
101 and suitable for processing by scripts or usage in generated
102 filenames. This field is optional and may not be implemented on all
103 systems. Examples: "VERSION_CODENAME=buster",
104 "VERSION_CODENAME=xenial"
105
106 VERSION_ID=
107 A lower-case string (mostly numeric, no spaces or other characters
108 outside of 0–9, a–z, ".", "_" and "-") identifying the operating
109 system version, excluding any OS name information or release code
110 name, and suitable for processing by scripts or usage in generated
111 filenames. This field is optional. Example: "VERSION_ID=17" or
112 "VERSION_ID=11.04".
113
114 PRETTY_NAME=
115 A pretty operating system name in a format suitable for
116 presentation to the user. May or may not contain a release code
117 name or OS version of some kind, as suitable. If not set, defaults
118 to "PRETTY_NAME="Linux"". Example: "PRETTY_NAME="Fedora 17 (Beefy
119 Miracle)"".
120
121 ANSI_COLOR=
122 A suggested presentation color when showing the OS name on the
123 console. This should be specified as string suitable for inclusion
124 in the ESC [ m ANSI/ECMA-48 escape code for setting graphical
125 rendition. This field is optional. Example: "ANSI_COLOR="0;31"" for
126 red, or "ANSI_COLOR="1;34"" for light blue.
127
128 CPE_NAME=
129 A CPE name for the operating system, in URI binding syntax,
130 following the Common Platform Enumeration Specification[2] as
131 proposed by the NIST. This field is optional. Example:
132 "CPE_NAME="cpe:/o:fedoraproject:fedora:17""
133
134 HOME_URL=, DOCUMENTATION_URL=, SUPPORT_URL=, BUG_REPORT_URL=,
135 PRIVACY_POLICY_URL=
136 Links to resources on the Internet related to the operating system.
137 HOME_URL= should refer to the homepage of the operating system, or
138 alternatively some homepage of the specific version of the
139 operating system. DOCUMENTATION_URL= should refer to the main
140 documentation page for this operating system. SUPPORT_URL= should
141 refer to the main support page for the operating system, if there
142 is any. This is primarily intended for operating systems which
143 vendors provide support for. BUG_REPORT_URL= should refer to the
144 main bug reporting page for the operating system, if there is any.
145 This is primarily intended for operating systems that rely on
146 community QA. PRIVACY_POLICY_URL= should refer to the main privacy
147 policy page for the operating system, if there is any. These
148 settings are optional, and providing only some of these settings is
149 common. These URLs are intended to be exposed in "About this
150 system" UIs behind links with captions such as "About this
151 Operating System", "Obtain Support", "Report a Bug", or "Privacy
152 Policy". The values should be in RFC3986 format[3], and should be
153 "http:" or "https:" URLs, and possibly "mailto:" or "tel:". Only
154 one URL shall be listed in each setting. If multiple resources need
155 to be referenced, it is recommended to provide an online landing
156 page linking all available resources. Examples:
157 "HOME_URL="https://fedoraproject.org/"" and
158 "BUG_REPORT_URL="https://bugzilla.redhat.com/""
159
160 BUILD_ID=
161 A string uniquely identifying the system image used as the origin
162 for a distribution (it is not updated with system updates). The
163 field can be identical between different VERSION_IDs as BUILD_ID is
164 an only a unique identifier to a specific version. Distributions
165 that release each update as a new version would only need to use
166 VERSION_ID as each build is already distinct based on the
167 VERSION_ID. This field is optional. Example:
168 "BUILD_ID="2013-03-20.3"" or "BUILD_ID=201303203".
169
170 VARIANT=
171 A string identifying a specific variant or edition of the operating
172 system suitable for presentation to the user. This field may be
173 used to inform the user that the configuration of this system is
174 subject to a specific divergent set of rules or default
175 configuration settings. This field is optional and may not be
176 implemented on all systems. Examples: "VARIANT="Server Edition"",
177 "VARIANT="Smart Refrigerator Edition"" Note: this field is for
178 display purposes only. The VARIANT_ID field should be used for
179 making programmatic decisions.
180
181 VARIANT_ID=
182 A lower-case string (no spaces or other characters outside of 0–9,
183 a–z, ".", "_" and "-"), identifying a specific variant or edition
184 of the operating system. This may be interpreted by other packages
185 in order to determine a divergent default configuration. This field
186 is optional and may not be implemented on all systems. Examples:
187 "VARIANT_ID=server", "VARIANT_ID=embedded"
188
189 LOGO=
190 A string, specifying the name of an icon as defined by
191 freedesktop.org Icon Theme Specification[4]. This can be used by
192 graphical applications to display an operating system's or
193 distributor's logo. This field is optional and may not necessarily
194 be implemented on all systems. Examples: "LOGO=fedora-logo",
195 "LOGO=distributor-logo-opensuse"
196
197 If you are reading this file from C code or a shell script to determine
198 the OS or a specific version of it, use the ID and VERSION_ID fields,
199 possibly with ID_LIKE as fallback for ID. When looking for an OS
200 identification string for presentation to the user use the PRETTY_NAME
201 field.
202
203 Note that operating system vendors may choose not to provide version
204 information, for example to accommodate for rolling releases. In this
205 case, VERSION and VERSION_ID may be unset. Applications should not rely
206 on these fields to be set.
207
208 Operating system vendors may extend the file format and introduce new
209 fields. It is highly recommended to prefix new fields with an OS
210 specific name in order to avoid name clashes. Applications reading this
211 file must ignore unknown fields. Example:
212 "DEBIAN_BTS="debbugs://bugs.debian.org/""
213
215 NAME=Fedora
216 VERSION="17 (Beefy Miracle)"
217 ID=fedora
218 VERSION_ID=17
219 PRETTY_NAME="Fedora 17 (Beefy Miracle)"
220 ANSI_COLOR="0;34"
221 CPE_NAME="cpe:/o:fedoraproject:fedora:17"
222 HOME_URL="https://fedoraproject.org/"
223 BUG_REPORT_URL="https://bugzilla.redhat.com/"
224
226 systemd(1), lsb_release(1), hostname(5), machine-id(5), machine-info(5)
227
229 1. Announcement of /etc/os-release
230 http://0pointer.de/blog/projects/os-release
231
232 2. Common Platform Enumeration Specification
233 http://scap.nist.gov/specifications/cpe/
234
235 3. RFC3986 format
236 https://tools.ietf.org/html/rfc3986
237
238 4. freedesktop.org Icon Theme Specification
239 http://standards.freedesktop.org/icon-theme-spec/latest
240
241
242
243systemd 241 OS-RELEASE(5)