YUM or Yellowdog Updater Modified is front-end tool for managing of rpm packages. Its used to install, remove, update & to gather information about  rpm packages through command line interface or by using graphical mode. Major advantage of using YUM is that, it resolves all the dependencies of the rpm packages & installs them along with the package.

Let's discuss some yum command examples,

(Recommended Read: Some pretty useful YUM tips & tricks)

(Also Read: Rollback an update on RHEL/CentOS – A simple guide )

 

YUM command examples

  • Installing a package                                                             yum install httpd

yum

  • Removing a package                                                              yum remove httpd

yum

  • Updating a package                                                                     yum update httpd

yum

  • List all installed packages                                                 yum list installed | less

yum

Here "| less" is used so we can browse through all the installed packages.

  • List single package                                                                 yum list httpd

yum

  • List all bundled group packages                                        yum grouplist

yum

  • Install a group package                                                    yum groupinstall ‘Minimal Install’

yum

  • Remove a group package                                            yum groupremove ‘NFS fille server’

yum

  • Search a single package                                                               yum search httpd

yum

  • List information for a package                                                  yum info httpd

yum

  • To find the files belonging to which package                   yum provides /etc/httpd/conf/httpd.conf

yum

  • Show all repolist (enabled & disabled)                                             yum repolist all

yum

  • Install a package from a particular repository                        yum --enablerepo=epel install nginx

yum

  • Clean yum cache                                                                                       yum clean all

yum

Default cache file for yum is stored at /var/cache/yum

  • Viewing YUM command history                                                       yum history

yum


Using YUM is fast & easy way to install rpm packages, as there is no need not worry about manually installing all the dependencies, which in many cases also has their own dependencies and thus you will end up spending a lot of time for just installing a single package.

We now have another new & improved package manager called DNF aka Dandified YUM, which is an improvement over YUM. We will discuss it in our coming tutorial . Also read our tutorial for using rpm commands with examples, give it a look (comes handy in many ways).

Please don’t forget to leave your feedback/queries in the comment box down below.

If you think we have helped you or just want to support us, please consider these :-

Connect to us: Facebook | Twitter | Google Plus

Donate us some of you hard earned money: [paypal-donation]

Linux TechLab is thankful for your continued support.