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, "ANSI_COLOR="1;34"" for light blue, or
127 "ANSI_COLOR="0;38;2;60;110;180"" for Fedora blue.
128
129 CPE_NAME=
130 A CPE name for the operating system, in URI binding syntax,
131 following the Common Platform Enumeration Specification[2] as
132 proposed by the NIST. This field is optional. Example:
133 "CPE_NAME="cpe:/o:fedoraproject:fedora:17""
134
135 HOME_URL=, DOCUMENTATION_URL=, SUPPORT_URL=, BUG_REPORT_URL=,
136 PRIVACY_POLICY_URL=
137 Links to resources on the Internet related to the operating system.
138 HOME_URL= should refer to the homepage of the operating system, or
139 alternatively some homepage of the specific version of the
140 operating system. DOCUMENTATION_URL= should refer to the main
141 documentation page for this operating system. SUPPORT_URL= should
142 refer to the main support page for the operating system, if there
143 is any. This is primarily intended for operating systems which
144 vendors provide support for. BUG_REPORT_URL= should refer to the
145 main bug reporting page for the operating system, if there is any.
146 This is primarily intended for operating systems that rely on
147 community QA. PRIVACY_POLICY_URL= should refer to the main privacy
148 policy page for the operating system, if there is any. These
149 settings are optional, and providing only some of these settings is
150 common. These URLs are intended to be exposed in "About this
151 system" UIs behind links with captions such as "About this
152 Operating System", "Obtain Support", "Report a Bug", or "Privacy
153 Policy". The values should be in RFC3986 format[3], and should be
154 "http:" or "https:" URLs, and possibly "mailto:" or "tel:". Only
155 one URL shall be listed in each setting. If multiple resources need
156 to be referenced, it is recommended to provide an online landing
157 page linking all available resources. Examples:
158 "HOME_URL="https://fedoraproject.org/"" and
159 "BUG_REPORT_URL="https://bugzilla.redhat.com/""
160
161 BUILD_ID=
162 A string uniquely identifying the system image used as the origin
163 for a distribution (it is not updated with system updates). The
164 field can be identical between different VERSION_IDs as BUILD_ID is
165 an only a unique identifier to a specific version. Distributions
166 that release each update as a new version would only need to use
167 VERSION_ID as each build is already distinct based on the
168 VERSION_ID. This field is optional. Example:
169 "BUILD_ID="2013-03-20.3"" or "BUILD_ID=201303203".
170
171 VARIANT=
172 A string identifying a specific variant or edition of the operating
173 system suitable for presentation to the user. This field may be
174 used to inform the user that the configuration of this system is
175 subject to a specific divergent set of rules or default
176 configuration settings. This field is optional and may not be
177 implemented on all systems. Examples: "VARIANT="Server Edition"",
178 "VARIANT="Smart Refrigerator Edition"" Note: this field is for
179 display purposes only. The VARIANT_ID field should be used for
180 making programmatic decisions.
181
182 VARIANT_ID=
183 A lower-case string (no spaces or other characters outside of 0–9,
184 a–z, ".", "_" and "-"), identifying a specific variant or edition
185 of the operating system. This may be interpreted by other packages
186 in order to determine a divergent default configuration. This field
187 is optional and may not be implemented on all systems. Examples:
188 "VARIANT_ID=server", "VARIANT_ID=embedded"
189
190 LOGO=
191 A string, specifying the name of an icon as defined by
192 freedesktop.org Icon Theme Specification[4]. This can be used by
193 graphical applications to display an operating system's or
194 distributor's logo. This field is optional and may not necessarily
195 be implemented on all systems. Examples: "LOGO=fedora-logo",
196 "LOGO=distributor-logo-opensuse"
197
198 If you are reading this file from C code or a shell script to determine
199 the OS or a specific version of it, use the ID and VERSION_ID fields,
200 possibly with ID_LIKE as fallback for ID. When looking for an OS
201 identification string for presentation to the user use the PRETTY_NAME
202 field.
203
204 Note that operating system vendors may choose not to provide version
205 information, for example to accommodate for rolling releases. In this
206 case, VERSION and VERSION_ID may be unset. Applications should not rely
207 on these fields to be set.
208
209 Operating system vendors may extend the file format and introduce new
210 fields. It is highly recommended to prefix new fields with an OS
211 specific name in order to avoid name clashes. Applications reading this
212 file must ignore unknown fields. Example:
213 "DEBIAN_BTS="debbugs://bugs.debian.org/""
214
215 Container and sandbox runtime managers may make the host's
216 identification data available to applications by providing the host's
217 /etc/os-release (if available, otherwise /usr/lib/os-release as a
218 fallback) as /run/host/os-release.
219
221 NAME=Fedora
222 VERSION="32 (Workstation Edition)"
223 ID=fedora
224 VERSION_ID=32
225 PRETTY_NAME="Fedora 32 (Workstation Edition)"
226 ANSI_COLOR="0;38;2;60;110;180"
227 LOGO=fedora-logo-icon
228 CPE_NAME="cpe:/o:fedoraproject:fedora:32"
229 HOME_URL="https://fedoraproject.org/"
230 DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f32/system-administrators-guide/"
231 SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
232 BUG_REPORT_URL="https://bugzilla.redhat.com/"
233 REDHAT_BUGZILLA_PRODUCT="Fedora"
234 REDHAT_BUGZILLA_PRODUCT_VERSION=32
235 REDHAT_SUPPORT_PRODUCT="Fedora"
236 REDHAT_SUPPORT_PRODUCT_VERSION=32
237 PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
238 VARIANT="Workstation Edition"
239 VARIANT_ID=workstation
240
242 systemd(1), lsb_release(1), hostname(5), machine-id(5), machine-info(5)
243
245 1. Announcement of /etc/os-release
246 http://0pointer.de/blog/projects/os-release
247
248 2. Common Platform Enumeration Specification
249 http://scap.nist.gov/specifications/cpe/
250
251 3. RFC3986 format
252 https://tools.ietf.org/html/rfc3986
253
254 4. freedesktop.org Icon Theme Specification
255 http://standards.freedesktop.org/icon-theme-spec/latest
256
257
258
259systemd 246 OS-RELEASE(5)