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=, SUPPORT_URL=, BUG_REPORT_URL=, PRIVACY_POLICY_URL=
135 Links to resources on the Internet related the operating system.
136 HOME_URL= should refer to the homepage of the operating system, or
137 alternatively some homepage of the specific version of the
138 operating system. SUPPORT_URL= should refer to the main support
139 page for the operating system, if there is any. This is primarily
140 intended for operating systems which vendors provide support for.
141 BUG_REPORT_URL= should refer to the main bug reporting page for the
142 operating system, if there is any. This is primarily intended for
143 operating systems that rely on community QA. PRIVACY_POLICY_URL=
144 should refer to the main privacy policy page for the operation
145 system, if there is any. These settings are optional, and providing
146 only some of these settings is common. These URLs are intended to
147 be exposed in "About this system" UIs behind links with captions
148 such as "About this Operating System", "Obtain Support", "Report a
149 Bug", or "Privacy Policy". The values should be in RFC3986
150 format[3], and should be "http:" or "https:" URLs, and possibly
151 "mailto:" or "tel:". Only one URL shall be listed in each setting.
152 If multiple resources need to be referenced, it is recommended to
153 provide an online landing page linking all available resources.
154 Examples: "HOME_URL="https://fedoraproject.org/"" and
155 "BUG_REPORT_URL="https://bugzilla.redhat.com/""
156
157 BUILD_ID=
158 A string uniquely identifying the system image used as the origin
159 for a distribution (it is not updated with system updates). The
160 field can be identical between different VERSION_IDs as BUILD_ID is
161 an only a unique identifier to a specific version. Distributions
162 that release each update as a new version would only need to use
163 VERSION_ID as each build is already distinct based on the
164 VERSION_ID. This field is optional. Example:
165 "BUILD_ID="2013-03-20.3"" or "BUILD_ID=201303203".
166
167 VARIANT=
168 A string identifying a specific variant or edition of the operating
169 system suitable for presentation to the user. This field may be
170 used to inform the user that the configuration of this system is
171 subject to a specific divergent set of rules or default
172 configuration settings. This field is optional and may not be
173 implemented on all systems. Examples: "VARIANT="Server Edition"",
174 "VARIANT="Smart Refrigerator Edition"" Note: this field is for
175 display purposes only. The VARIANT_ID field should be used for
176 making programmatic decisions.
177
178 VARIANT_ID=
179 A lower-case string (no spaces or other characters outside of 0–9,
180 a–z, ".", "_" and "-"), identifying a specific variant or edition
181 of the operating system. This may be interpreted by other packages
182 in order to determine a divergent default configuration. This field
183 is optional and may not be implemented on all systems. Examples:
184 "VARIANT_ID=server", "VARIANT_ID=embedded"
185
186 If you are reading this file from C code or a shell script to determine
187 the OS or a specific version of it, use the ID and VERSION_ID fields,
188 possibly with ID_LIKE as fallback for ID. When looking for an OS
189 identification string for presentation to the user use the PRETTY_NAME
190 field.
191
192 Note that operating system vendors may choose not to provide version
193 information, for example to accommodate for rolling releases. In this
194 case, VERSION and VERSION_ID may be unset. Applications should not rely
195 on these fields to be set.
196
197 Operating system vendors may extend the file format and introduce new
198 fields. It is highly recommended to prefix new fields with an OS
199 specific name in order to avoid name clashes. Applications reading this
200 file must ignore unknown fields. Example:
201 "DEBIAN_BTS="debbugs://bugs.debian.org/""
202
204 NAME=Fedora
205 VERSION="17 (Beefy Miracle)"
206 ID=fedora
207 VERSION_ID=17
208 PRETTY_NAME="Fedora 17 (Beefy Miracle)"
209 ANSI_COLOR="0;34"
210 CPE_NAME="cpe:/o:fedoraproject:fedora:17"
211 HOME_URL="https://fedoraproject.org/"
212 BUG_REPORT_URL="https://bugzilla.redhat.com/"
213
215 systemd(1), lsb_release(1), hostname(5), machine-id(5), machine-info(5)
216
218 1. Announcement of /etc/os-release
219 http://0pointer.de/blog/projects/os-release
220
221 2. Common Platform Enumeration Specification
222 http://scap.nist.gov/specifications/cpe/
223
224 3. RFC3986 format
225 https://tools.ietf.org/html/rfc3986
226
227
228
229systemd 239 OS-RELEASE(5)