yum list
The yum list command will list both installed and available packages.
~]# yum list
openssh-server.x86_64 2.4.6-45.el7.centos.4 @base
openssl.x86_64 2.4.6-45.el7.centos.4 @base
krb5.x86_64 2.4.6-45.el7.centos.4 @updates
nginx.x86_64 2.4.6-45.el7.centos.4 @base
httpd.x86_64 2.4.6-45.el7.centos.4 @base
...
The yum list installed command can also be used to list only installed packages.
~]# yum list installed | grep -i httpd
Installed Packages
httpd.x86_64 2.4.6-45.el7.centos.4 @updates
yum info
The yum info package_name command can be used to view information about a package, regarless if the package is or is not installed on your system.
~]# yum info httpd
Name : httpd
Arch : x86_64
Version : 2.4.6
Release : 45.el7.centos.4
Size : 9.4 M
Repo : installed
From repo : updates
Summary : Apache HTTP Server
URL : http://httpd.apache.org/
License : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and exensible
: web server.
yum group info
Yum group info package_name can be used to display information on a group package.
~]# yum group info package_name
yum provides
Yum provides file_name can be used to determine the package that provides a certain file.
~]# yum provides /path/to/file
yum install
The yum install package_name command can be used to install a package.
~]# yum install httpd
yum group install
Package groups can also be installed. Double quotes must be used if there is a space in the group name.
~]# yum group install "group name"
~]# yum group install group-name
yumdownloader
The yumdownloader command can be used to download but not install a package. The yumdownloader command is included in the yum-utils package. Install yum-utils.
~]# yum install yum-utils
After yum-utils is installed, the yumdownloader command can be used. For example, yumdownloader httpd downloads the HTTPD package.
~]# yumdownloader httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached host
file * base: mirror.es.its.nyu.edu * extras: mirrors.gigenet.com * updates: mirror.nexcess.net
httpd-version.rpm
The --destdir option can be used to specify a directory other than the present working directory.
~]# yumdownloader --destdir /home/<username>/Downloads httpd
Notice the last line in the yumdownloader output lists the HTTPD RPM. The LS command can be used to verify that the RPM was downloaded.
~]# ls
httpd-version.rpm
Once the RPM has been downloaded, the RPM -i httpd-version.rpm command can be used to install the package.
~]# rpm -i httpd-version.rpm
~]# rpm --install httpd-version.rpm
yum update
The update option updates a package.
~]# yum update package_name
yum remove / yum erase
The remove or erase option will uninstall a package, but not remove the configuration files. There is no difference between remove and erase.
~]# yum remove package_name
~]# yum erase package_name
Add group to remove a group package.
~]# yum group remove "group name"
Did you find this article helpful?
If so, consider buying me a coffee over at