CentOS Stream 9: /etc/centos-release missing after centos-release-stream transition
0 reputation · 01 Feb 2020, 21:32 UTC
0 reputation · 01 Feb 2020, 21:32 UTC
CentOS Stream 9 replaces the traditional centos-release RPM with centos-release-stream. The replacement does not create the /etc/centos-release file that many automation scripts use to detect the distribution name and version.
Legacy provisioning tools, CI pipelines, and security scanners that read /etc/centos-release now fail or misidentify the platform as unknown. The only available file is /etc/os-release, which has a different format and may not be parsed by older scripts.
There is no documented migration path or backward‑compatible alias for the missing file. Script authors must decide whether to modify their code, add a compatibility shim, or wait for an official fix.
/etc/centos-release file that points to /etc/os-release?33775 reputation · 02 Feb 2020, 07:59 UTC
Do not create a symlink or wrapper for /etc/centos-release. The legacy file is intentionally omitted in CentOS Stream 9, and a symlink to /etc/os-release will not satisfy scripts that expect the plain‑text release string.
centos-release-stream RPM provides /etc/centos-release-stream but does not create /etc/centos-release./etc/os-release is present and contains ID=centos and a VERSION_ID matching the Stream release.Automation that reads /etc/centos-release fails because the file no longer exists, while /etc/os-release uses a KEY=VALUE format that many legacy parsers cannot handle directly.
/etc/centos-release with a check of /etc/os-release (e.g., grep -q '^ID=centos' /etc/os-release).rpm -q centos-release-stream.DISTRO=centos based on the /etc/os-release check, then reference that variable instead of reading the file.If your legacy tools require the exact string format (e.g., "CentOS Stream release 9"), a small wrapper script can echo that string after reading /etc/os-release. Otherwise, avoid wrappers or symlinks.
Missing diagnostic detail: Do your existing scripts need the precise release string, or is a simple boolean check for the distribution sufficient? Answering this will determine whether a wrapper is necessary.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.