Linux Package Management - YUM

YUM

YUM (Yellowdog Updater Modified) is an open source command-line as well as graphical based package management tool for RPM (RedHat Package Manager) based Linux systems.

20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management

  1. Install a Package with YUM

To install a package called Firefox 14, just run the below command it will automatically find and install all required dependencies for Firefox.

# yum install firefox
Loaded plugins: fastestmirror
Dependencies Resolved
================================================================================================
Package                    Arch        Version                    Repository            Size        
================================================================================================
Updating:
firefox                        i686        10.0.6-1.el6.centos     updates             20 M
Updating for dependencies:
xulrunner                     i686        10.0.6-1.el6.centos     updates             12 M
Transaction Summary
================================================================================================
Install       0 Package(s)
Upgrade       2 Package(s)
Total download size: 32 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): firefox-10.0.6-1.el6.centos.i686.rpm                                |  20 MB   01:10
(2/2): xulrunner-10.0.6-1.el6.centos.i686.rpm                              |  12 MB   00:52
------------------------------------------------------------------------------------------------
Total                                                           63 kB/s |  32 MB   02:04
Updated:
firefox.i686 0:10.0.6-1.el6.centos
Dependency Updated:
xulrunner.i686 0:10.0.6-1.el6.centos
Complete!
The above command will ask confirmation before installing any package on your system. If you want to install packages automatically without asking any confirmation, use option -y as shown in below example.

# yum -y install firefox
  1. Removing a Package with YUM

To remove a package completely with their all dependencies, just run the following command as shown below.

  1. Updating a Package using YUM

Let’s say you have outdated version of MySQL package and you want to update it to the latest stable version. Just run the following command it will automatically resolves all dependencies issues and install them.

  1. List a Package using YUM

Use the list function to search for the specific package with name. For example to search for a package called openssh, use the command.

  1. Search for a Package using YUM

If you don’t remember the exact name of the package, then use search function to search all the available packages to match the name of the package you specified. For example, to search all the packages that matches the word .

  1. Get Information of a Package using YUM

Say you would like to know information of a package before installing it. To get information of a package just issue the below command.

  1. List all Available Packages using YUM

To list all the available packages in the Yum database, use the below command.

  1. List all Installed Packages using YUM

To list all the installed packages on a system, just issue below command, it will display all the installed packages.

  1. Yum Provides Function

    Yum provides function is used to find which package a specific file belongs to. For example, if you would like to know the name of the package that has the /etc/httpd/conf/httpd.conf.

  1. Check for Available Updates using Yum

    To find how many of installed packages on your system have updates available, to check use the following command.

  1. List all available Group Packages

    In Linux, number of packages are bundled to particular group. Instead of installing individual packages with yum, you can install particular group that will install all the related packages that belongs to the group. For example to list all the available groups, just issue following command.

  1. Install a Group Packages

    To install a particular package group, we use option as groupinstall. Fore example, to install “MySQL Database“, just execute the below command.

  1. Update a Group Packages

    To update any existing installed group packages, just run the following command as shown below.

  1. Remove a Group Packages

    To delete or remove any existing installed group from the system, just use below command.

  1. List Enabled Yum Repositories

    To list all enabled Yum repositories in your system, use following option.

  1. List all Enabled and Disabled Yum Repositories

    The following command will display all enabled and disabled yum repositories on the system.

  1. Install a Package from Specific Repository

    To install a particular package from a specific enabled or disabled repository, you must use –enablerepo option in your yum command. For example to Install PhpMyAdmin 3.5.2 package, just execute the command.

  1. Interactive Yum Shell

    Yum utility provides a custom shell where you can execute multiple commands.

  1. Clean Yum Cache

    By default yum keeps all the repository enabled package data in /var/cache/yum/ with each sub-directory, to clean all cached files from enabled repository, you need to run the following command regularly to clean up all the cache and make sure that there is nothing unnecessary space is using. We don’t want to give the output of the below command, because we like to keep cached data as it is.

  1. View History of Yum

    To view all the past transactions of yum command, just use the following command.

We have tried to cover all the basic to advance yum commands with their examples. If anything related to yum commands may have missed out. Please update us through our comment box. So, we keep updating the same based on feedback’s received.

Last updated

Was this helpful?