Skip to content
Latchkey

yum install: Usage, Options & Common CI Errors

yum install adds packages on older Red Hat systems (CentOS 7, RHEL 7).

yum is the legacy package manager on RHEL 7 / CentOS 7. On RHEL 8+ it is a compatibility symlink to dnf. The dominant CI failure today is CentOS 7 reaching end-of-life and its mirrors going offline.

What it does

yum install resolves and installs packages with their dependencies from the configured .repo files. On modern Red Hat releases yum is just an alias for dnf, so the flags are largely identical; on CentOS 7 it is the real, older implementation.

Common usage

Terminal
yum install -y git curl
yum install -y epel-release                  # enable EPEL
yum install -y --enablerepo=epel htop
yum clean all && rm -rf /var/cache/yum

Common errors in CI

CentOS 7 hit EOL on 2024-06-30, so "Could not resolve host: mirrorlist.centos.org" or "Cannot find a valid baseurl for repo: base/7" now breaks many old images - point the .repo files at vault.centos.org instead. "No package X available" means the repo (often EPEL) is not enabled. "Public key for X is not installed" needs the repo GPG key imported (rpm --import). Prefer migrating CI to dnf on a supported base (Rocky/Alma/RHEL 8+).

Options

FlagWhat it does
-y / --assumeyesAssume yes (required in CI)
--enablerepo / --disablerepoToggle a repo for this run
--nogpgcheckSkip GPG verification
clean allPurge cached metadata and packages

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →