Skip to content
Latchkey

yum Command Reference: Flags, Usage & CI Examples

yum is the classic package manager for RHEL, CentOS, and Amazon Linux.

yum installs, updates, and removes RPM packages with dependency resolution on older Red Hat-family systems. On newer releases dnf supersedes it, often as a compatibility alias.

Common flags and usage

  • install <pkg...>: install packages
  • -y / --assumeyes: assume yes to prompts
  • remove / erase <pkg>: remove packages
  • update: upgrade installed packages
  • makecache: build the metadata cache
  • clean all: clear cached metadata and packages

Example

shell
yum install -y postgresql gcc make
yum clean all && rm -rf /var/cache/yum

In CI

Pass -y so installs never block on a prompt. Run yum clean all (and remove /var/cache/yum) at the end of a Docker layer to keep the image small. On newer images yum is a symlink to dnf, so behavior matches dnf.

Key takeaways

  • yum installs RPM packages with dependency resolution.
  • -y keeps installs noninteractive in CI.
  • On modern images yum is an alias for dnf.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →