$linuxjunkies
>

yum(8)

yum is a package manager that installs, updates, and removes software packages on Red Hat-based Linux systems.

UbuntuDebianFedoraArch

Synopsis

yum [OPTION]... COMMAND [PACKAGE]...

Description

yum (Yellowdog Updater Modified) is the primary package manager for RHEL, CentOS, and Fedora systems. It resolves dependencies automatically and manages RPM packages from configured repositories. Modern systems increasingly use dnf, which is yum's successor with improved performance.

yum maintains a local cache of repository metadata and can install, remove, update, or search packages. It requires root privileges for most operations and reads configuration from /etc/yum.conf and /etc/yum.repos.d/.

Common options

FlagWhat it does
-y, --assumeyesassume yes to all prompts; useful for automated scripts
-q, --quietsuppress output messages
-v, --verboseincrease verbosity of output
--no-cachedo not use cached package data
--enablerepo=REPOtemporarily enable a disabled repository
--disablerepo=REPOtemporarily disable an enabled repository
-x, --exclude=PACKAGEexclude package from updates or installation
--cacheonlyuse only cached metadata without contacting repositories

Examples

install the nginx web server package and its dependencies

sudo yum install nginx

remove the Apache HTTP server package

sudo yum remove httpd

update all installed packages to their latest versions

sudo yum update

search repositories for packages matching 'vim'

yum search vim

display detailed information about the curl package

yum info curl

install PHP and MySQL PHP extension without prompting

sudo yum install -y php php-mysql

show all installed kernel packages

yum list installed | grep kernel

clear yum's local cache to free disk space

sudo yum clean all

Related commands