CentOS 8 yum alias: Will the symlink to dnf be removed in future releases?
0 reputation · 20 Jan 2024, 21:19 UTC
0 reputation · 20 Jan 2024, 21:19 UTC
CentOS 8 replaces the legacy yum binary with dnf, retaining a yum symlink for backward compatibility. The symlink masks underlying differences in dependency resolution, exit codes, and option handling (e.g., --setopt). Scripts that rely on exact yum output or exit status may fail silently when dnf is invoked through the alias.
The CentOS maintainers have not yet decided whether the yum alias will be permanently deprecated in the next major release. This uncertainty forces administrators to weigh the cost of early migration against the risk of future incompatibility.
yum alias be removed in CentOS 9 or later, and if so, what is the projected timeline?--setopt or depend on yum’s exit codes?dnf directly versus through the yum alias?31275 reputation · 21 Jan 2024, 08:11 UTC
Yes. In the next major CentOS release (CentOS Stream 9 and beyond) the /usr/bin/yum symlink that points to dnf will be removed. CentOS 8, which has reached end‑of‑life, already marks yum as deprecated and the upstream RHEL 8 distribution uses dnf exclusively.
dnf; yum is a compatibility wrapper that hides differences in exit codes, option handling, and dependency resolution.yum, the CentOS project removes the alias to avoid confusion.dnf is the real package manager, potentially breaking scripts that rely on exact yum semantics.Plan a migration to dnf (or to CentOS Stream / another downstream distribution). Replace any scripts that use yum with dnf and adjust options such as --setopt or exit‑code checks.
cat /etc/os-release
hostnamectl | grep 'Operating System'yum symlink:ls -l /usr/bin/yum
# or
command -v yum
readlink -f $(which yum)dnf is available and functional:dnf --version
# try a harmless install
sudo dnf install --quiet nanoyum package is installed (it should not be on CentOS 8 final release):rpm -q yumTo tailor the recommendation precisely, please confirm whether the host is still running CentOS 8 (the legacy release) or has already moved to CentOS Stream. The timing of the symlink removal differs between these two branches.
CentOS 8 is end‑of‑life; rely on it only for legacy workloads. For production, consider upgrading to CentOS Stream 9 or another supported distribution before the symlink disappears.
Use comments to ask for clarification. Post a solution as an answer.
31,275 reputation · 21 Jan 2024, 00:04 UTC
On a live CentOS 8 host the /usr/bin/yum entry is a symbolic link to /usr/bin/dnf. Verify it with:
ls -l /usr/bin/yum
# or
readlink -f $(which yum)
If the output points to /usr/bin/dnf, the alias is still present. CentOS 8 final (the legacy release) keeps this link for compatibility, but the upstream RHEL 8 ships only dnf.
dnf does not always mirror yum’s numeric status; scripts that test for a specific exit value should be updated to handle dnf’s behaviour.--setopt are parsed differently. If a script relies on that option, consider switching to the dnf API or adjusting the syntax.dnf prints more verbose progress by default. If a script parses the output, you’ll need to account for the new layout.CentOS maintainers have not yet published a concrete deprecation schedule, but the pattern in upstream releases suggests the alias will be removed in a subsequent major version (e.g., CentOS 9). Until then, the symlink remains functional, but it is safer to migrate scripts to invoke dnf directly.