Installing and maintaining repository based software in RHEL family of distributions is handled by YUM. Repository preferences are configured in /etc/yum.repos.d/ directory and by the /etc/yum.conf configuration file. The .rpm files are usually compressed with rpm2cpio tool. To “unpack” the package use following command: (-i to restore archive, -d to create leading directories)
# rpm2cpio package-3.2.1-X10-x86_64.rpm | cpio -id
Install packages
Install package and all required dependencies
# yum install nginx
Install group of packages related to mysql
# yum groupinstall ‘MySQL Database’
Install this package from this repository
# yum --enablerepo=epel install nginx
Download package, without installing it (–resolve adds dependencies to the download)
# yumdownloader --resolve nginx
Remove packages
Remove package and all dependencies
# yum remove nginx
Remove this package bundle
# yum groupremove ‘MySQL Database’
Remove all cached files
# yum clean all
Upgrade packages
See packages that can be updated
# yum check-update
Update the system (installs latest patches and security fixes)
# yum update
Update package and all dependencies to its latest stable version
# yum update firefox
Update all packages in this package group
# yum groupupdate ‘MySQL Database’
Query packages
Display information about installed packages
# yum list | less
Search for the specific package in repositories
# yum list openssh
List all installed packages
# yum list installed | less
Search all available packages in repositories, by name
# yum search openssh
Get information about package before installing it
# yum info firefox
Find which package this file belongs to
# yum provides /etc/httpd/conf/httpd.conf
List all available bundles of packages
# yum grouplist
List all repositories system uses
# yum repolist
List enabled and disabled yum repositories system is using
# yum repolist all