Yum Package Manager

Managing Packages with Yum

YUM - Package Manager


YUM ( originally known as Yellowdog Updater Modified) is a command line package manager for use with rpm based Linux distributions. Yum was originally created to manage Red Hat Enterprise Linux systems, however many other popular distributions now use this tool as the command line package manager of choice. Distributions such as CentOS and Fedora use Yum. Yum offers a simple to use interface for the updating, and removal of packages. Yum also handles all dependencies and pre-requisites.


YUM Command Examples


The most common functions used within Yum are the "install", "erase", "update", "list" and "search". However, yum has many more functions that can be carried out. Below are some of the common uses for yum:



Display YUM Version


Basic Syntax: yum --version



[root@centos01a ~]# yum --version
3.2.29
  Installed: rpm-4.8.0-47.el6.x86_64 at 2015-10-25 22:23
  Built    : CentOS BuildSystem  at 2015-07-24 11:28
  Committed: Lubos Kardos  at 2015-06-15

  Installed: yum-3.2.29-69.el6.centos.noarch at 2015-10-25 22:24
  Built    : CentOS BuildSystem  at 2015-07-24 10:28
  Committed: Johnny Hughes  at 2015-07-22

  Installed: yum-plugin-fastestmirror-1.1.30-30.el6.noarch at 2015-10-25 22:24
  Built    : CentOS BuildSystem  at 2014-10-15 07:16
  Committed: Valentina Mukhamedzhanova  at 2014-08-11

The above command is used to display the currently installed version of the yum package manager.


Displaying Repositories - yum repolist


Basic Syntax: yum repolist



[root@centos01a ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
repo id          repo name                                                status
base             CentOS-6 - Base                                           6,575
epel             Extra Packages for Enterprise Linux 6 - x86_64           12,004
extras           CentOS-6 - Extras                                            50
updates          CentOS-6 - Updates                                        1,218
repolist: 19,847

The command "yum repolist" will display all enabled repositories. You may pass an additional parameter of "all" to display enabled and disabled repositories.


Yum installing a package


Basic Syntax: yum install package-name



[root@centos01a ~]# yum install htop
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:1.0.1-2.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch              Version                Repository       Size
================================================================================
Installing:
 htop            x86_64            1.0.1-2.el6            epel             75 k

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 75 k
Installed size: 161 k
Is this ok [y/N]:

If the package is available within our repositories, then we are prompted to reply "y/N" to confirm our actions. In this case we are going to reply "y" to install the package called "htop"



Downloading Packages:
htop-1.0.1-2.el6.x86_64.rpm                              |  75 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : htop-1.0.1-2.el6.x86_64                                      1/1 
  Verifying  : htop-1.0.1-2.el6.x86_64                                      1/1 

Installed:
  htop.x86_64 0:1.0.1-2.el6                                                     

Complete!

As you can see from the above, the requested package has been installed successfully.


Removing a package: yum erase package-name or yum remove package-name


Basic Syntax: yum erase package-name



[root@centos01a ~]# yum erase htop
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:1.0.1-2.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch             Version                  Repository       Size
================================================================================
Removing:
 htop           x86_64           1.0.1-2.el6              @epel           161 k

Transaction Summary
================================================================================
Remove        1 Package(s)

Installed size: 161 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : htop-1.0.1-2.el6.x86_64                                      1/1 
  Verifying  : htop-1.0.1-2.el6.x86_64                                      1/1 

Removed:
  htop.x86_64 0:1.0.1-2.el6                                                     

Complete!

In this example we removed the package "htop" with the command "yum erase htop". You can also use the "remove" option to achieve the same result.


Listing Installed Packages - yum list installed


Basic Syntax: yum list installed



[root@centos01a ~]# yum list installed
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
Installed Packages
MAKEDEV.x86_64       3.24-6.el6         @anaconda-CentOS-201508042137.x86_64/6.7
acl.x86_64           2.2.49-6.el6       @anaconda-CentOS-201508042137.x86_64/6.7
attr.x86_64          2.4.44-7.el6       @anaconda-CentOS-201508042137.x86_64/6.7
audit.x86_64         2.3.7-5.el6        @anaconda-CentOS-201508042137.x86_64/6.7
audit-libs.x86_64    2.3.7-5.el6        @anaconda-CentOS-201508042137.x86_64/6.7
authconfig.x86_64    6.1.12-23.el6      @anaconda-CentOS-201508042137.x86_64/6.7
b43-openfwwf.noarch  5.2-10.el6         @anaconda-CentOS-201508042137.x86_64/6.7
basesystem.noarch    10.0-4.el6         @anaconda-CentOS-201508042137.x86_64/6.7
bash.x86_64          4.1.2-33.el6_7.1   @updates                                
binutils.x86_64      2.20.51.0.2-5.43.el6

In the above example we issued the "yum list installed" command. This command will display any packages that have been installed on your Linux system. However, the output returned will be considerable in size. Above is a small section from the output of this command.




Listing All Packages - yum list


Basic Syntax: yum list



[root@centos01a ~]# yum list 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
Installed Packages
MAKEDEV.x86_64                              3.24-6.el6                   @anaconda-CentOS-201508042137.x86_64/6.7
acl.x86_64                                  2.2.49-6.el6                 @anaconda-CentOS-201508042137.x86_64/6.7
attr.x86_64                                 2.4.44-7.el6                 @anaconda-CentOS-201508042137.x86_64/6.7
audit.x86_64                                2.3.7-5.el6                  @anaconda-CentOS-201508042137.x86_64/6.7
audit-libs.x86_64                           2.3.7-5.el6                  @anaconda-CentOS-201508042137.x86_64/6.7
authconfig.x86_64                           6.1.12-23.el6                @anaconda-CentOS-201508042137.x86_64/6.7
b43-openfwwf.noarch                         5.2-10.el6                   @anaconda-CentOS-201508042137.x86_64/6.7
basesystem.noarch 

In the above example, we can see both "Installed Packages" and "Available Packages". (The above output is an extract of the full output).


Listing information about a package - yum info


Basic Syntax: yum info package-name



[root@centos01a ~]# yum info htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
Available Packages
Name        : htop
Arch        : x86_64
Version     : 1.0.1
Release     : 2.el6
Size        : 75 k
Repo        : epel
Summary     : Interactive process viewer
URL         : http://htop.sourceforge.net/
License     : GPL+
Description : htop is an interactive text-mode process viewer for Linux, similar
            : to top(1).

In the above example we used the "yum info" command to list information relating to an installed package. The output will specify if the package is installed or available.


Checking for Updates - yum check-update


Basic Syntax: yum check-update

The "yum check-update" command can be run to check for any updates to packages on your system. Any updates that are available will then be displayed. You may also use the command "yum list updates". Any updates that are available to your system will be displayed.



Check for updates for specific package - yum list package


Basic Syntax: yum list package



[root@centos01a ~]# yum list openssl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirrors.ukfast.co.uk
 * extras: repo.bigstepcloud.com
 * updates: mirror.ukhost4u.com
Installed Packages
openssl.x86_64    1.0.1e-42.el6         @anaconda-CentOS-201508042137.x86_64/6.7
Available Packages
openssl.i686      1.0.1e-42.el6_7.2     updates                                 
openssl.x86_64    1.0.1e-42.el6_7.2     updates  

In the above example we were checking for any available updates for the package called "openssl". The relevant information is displayed under the headings "Available Packages" and "Available Packages". In the above example we can see that a newer version of the openssl package is available.


Update all Installed Packages - yum update


Basic Syntax: yum update



[root@centos01a ~]# yum update
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
No Packages marked for Update 

In the above example we are installing any updates that are available for any installed packages on our system. In the above example, no updates were found as the system is upto-date. If packages are available, they will be displayed as number of packages to be installed along with the number of packages to be upgraded.


Searching for a package - yum search pattern


Basic Syntax: yum search pattern



[root@centos01a ~]# yum search bash
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
============================== N/S Matched: bash ===============================
bash-argsparse.noarch : An high level argument parsing library for bash
bash-completion.noarch : Programmable completion for Bash
bash-doc.x86_64 : Documentation files for bash
bashdb.noarch : BASH debugger, the BASH symbolic debugger
easybashgui.noarch : Bash function library
emacs-bashdb.noarch : Bashdb support for Emacs
emacs-bashdb-el.noarch : Elisp source files for Bashdb support for Emacs
gromacs-bash.noarch : GROMACS bash completion
bash.x86_64 : The GNU Bourne Again shell
bats.noarch : Bash Automated Testing System
bti.x86_64 : Bash Twitter Idiocy
python-argcomplete.noarch : Bash tab completion for argparse
sys_basher.x86_64 : A multithreaded hardware exerciser

  Name and summary matches only, use "search all" for everything.

In the above example we searched for any packages that contained the string "bash". This option is useful if you do not know the full name of a package.


yum provides


Basic Syntax: yum provides provide-spec

Displays what package provides the specified file.



[root@centos01a ~]# yum provides htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
htop-1.0.1-2.el6.x86_64 : Interactive process viewer
Repo        : epel
Matched from:

htop-1.0.1-2.el6.x86_64 : Interactive process viewer
Repo        : installed
Matched from:
Other       : Provides-match: htop


Reinstalling a Package - yum reinstall


Basic Syntax: yum reinstall package name

The "yum reinstall" command is used to reinstall the specified package.



[root@centos01a ~]# yum reinstall htop
Loaded plugins: fastestmirror
Setting up Reinstall Process
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:1.0.1-2.el6 will be reinstalled
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch              Version                Repository       Size
================================================================================
Reinstalling:
 htop            x86_64            1.0.1-2.el6            epel             75 k

Transaction Summary
================================================================================
Reinstall     1 Package(s)

Total download size: 75 k
Installed size: 161 k
Is this ok [y/N]: y
Downloading Packages:
htop-1.0.1-2.el6.x86_64.rpm                              |  75 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : htop-1.0.1-2.el6.x86_64                                      1/1 
  Verifying  : htop-1.0.1-2.el6.x86_64                                      1/1 

Installed:
  htop.x86_64 0:1.0.1-2.el6                                                     

Complete!

Updating specific packages - yum update


Basic Syntax: yum update package name

The "yum update" command is used to update specific packages. Before using the update option, it is useful to check the current version of the package and check to see whether a newer version is available. To do this we use the "yum list" command to show the currently installed version and any versions that are available.



[root@centos02a ~]# yum list openssl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirrors.ukfast.co.uk
 * extras: repo.bigstepcloud.com
 * updates: mirror.ukhost4u.com
Installed Packages
openssl.x86_64    1.0.1e-42.el6         @anaconda-CentOS-201508042137.x86_64/6.7
Available Packages
openssl.i686      1.0.1e-42.el6_7.2     updates                                 
openssl.x86_64    1.0.1e-42.el6_7.2     updates 

From the above output we can see that the package "openssl.x86_64" is at version "1.0.1e-42.el6" and an updated version "1.0.1e-42.el6_7.2" is available. To update this package, we use the "yum update" command:



[root@centos02a ~]# yum update openssl.x86_64
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirrors.ukfast.co.uk
 * extras: repo.bigstepcloud.com
 * updates: mirror.ukhost4u.com
Resolving Dependencies
--> Running transaction check
---> Package openssl.x86_64 0:1.0.1e-42.el6 will be updated
---> Package openssl.x86_64 0:1.0.1e-42.el6_7.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch           Version                   Repository       Size
================================================================================
Updating:
 openssl         x86_64         1.0.1e-42.el6_7.2         updates         1.5 M

Transaction Summary
================================================================================
Upgrade       1 Package(s)

Total download size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
openssl-1.0.1e-42.el6_7.2.x86_64.rpm                     | 1.5 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : openssl-1.0.1e-42.el6_7.2.x86_64                             1/2 
  Cleanup    : openssl-1.0.1e-42.el6.x86_64                                 2/2 
  Verifying  : openssl-1.0.1e-42.el6_7.2.x86_64                             1/2 
  Verifying  : openssl-1.0.1e-42.el6.x86_64                                 2/2 

Updated:
  openssl.x86_64 0:1.0.1e-42.el6_7.2                                            

Complete!

Downgrading a Package - yum downgrade


Basic Syntax: yum downgrade package name

The "yum downgrade" command is used to downgrade the specified packages to the highest of all known lower versions if possible. In the following example, we will downgrade the previously updated package "openssl.x86_64". To establish the current version of the package we used the command "yum list".



[root@centos02a ~]# yum list openssl.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirrors.ukfast.co.uk
 * extras: repo.bigstepcloud.com
 * updates: mirror.ukhost4u.com
Installed Packages
openssl.x86_64                    1.0.1e-42.el6_7.2                     @updates
[root@centos02a ~]# yum downgrade openssl.x86_64
Loaded plugins: fastestmirror
Setting up Downgrade Process
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirrors.ukfast.co.uk
 * extras: repo.bigstepcloud.com
 * updates: mirror.ukhost4u.com
Resolving Dependencies
--> Running transaction check
---> Package openssl.x86_64 0:1.0.1e-42.el6_7.1 will be a downgrade
---> Package openssl.x86_64 0:1.0.1e-42.el6_7.2 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch           Version                   Repository       Size
================================================================================
Downgrading:
 openssl         x86_64         1.0.1e-42.el6_7.1         updates         1.5 M

Transaction Summary
================================================================================
Downgrade     1 Package(s)

Total download size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
openssl-1.0.1e-42.el6_7.1.x86_64.rpm                     | 1.5 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : openssl-1.0.1e-42.el6_7.1.x86_64                             1/2 
  Cleanup    : openssl-1.0.1e-42.el6_7.2.x86_64                             2/2 
  Verifying  : openssl-1.0.1e-42.el6_7.1.x86_64                             1/2 
  Verifying  : openssl-1.0.1e-42.el6_7.2.x86_64                             2/2 

Removed:
  openssl.x86_64 0:1.0.1e-42.el6_7.2                                            

Installed:
  openssl.x86_64 0:1.0.1e-42.el6_7.1                                            

Complete!

Working with Package Groups - yum grouplist


Many packages are grouped together into convenient groups. This allows a system administrator to install a group of packages with one single command. The command "yum grouplist" can be used to display available groups on your system. (Below is an extract of the "grouplist" command).



[root@centos01a ~]# yum grouplist
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
Installed Groups:
   E-mail server
   Scalable Filesystems
   Security Tools
   Storage Availability Tools
   iSCSI Storage Client
Available Groups:
   Additional Development
   Backup Client
   Backup Server
   Base
   CIFS file server
   Client management tools
   Compatibility libraries
   Console internet tools
   Debugging Tools
   Desktop
   Desktop Debugging and Performance Tools
   Desktop Platform
   Desktop Platform Development
   Development tools
   Dial-up Networking Support
   Directory Client
   Directory Server
   Eclipse
   Educational Software
   Electronic Lab
   Emacs
   

Install a Group of Packages - yum groupinstall groupname


In the example below we are going to install the 'X Window System'. To install the X Window System group of packages, we issue the command "yum groupinstall 'X Window System'". (Please note, if the group package contains spaces within its name, then you must place single quotes around the group name.) The output below is only a small extract of what will be installed. We can see that there are 233 packages that make up the group 'X Window System'.



[root@centos01a ~]# yum groupinstall 'X Window System'

 xorg-x11-drv-trident            x86_64 1.3.6-10.el6              base     59 k
 xorg-x11-drv-v4l                x86_64 0.2.0-36.el6              base     18 k
 xorg-x11-drv-vesa               x86_64 2.3.2-15.el6              base     22 k
 xorg-x11-drv-vmmouse            x86_64 13.0.0-2.el6              base     17 k
 xorg-x11-drv-vmware             x86_64 13.0.1-9.el6              base     32 k
 xorg-x11-drv-void               x86_64 1.4.0-23.el6              base     13 k
 xorg-x11-drv-voodoo             x86_64 1.2.5-10.el6              base     18 k
 xorg-x11-drv-wacom              x86_64 0.23.0-4.el6              base    258 k
 xorg-x11-drv-xgi                x86_64 1.6.0-20.20121114git.el6  base    117 k
 xorg-x11-glamor                 x86_64 0.6.0-5.20140506gitf78901e.el6
                                                                  base    103 k
 xorg-x11-server-common          x86_64 1.15.0-36.el6.centos      base     50 k
 xorg-x11-xkb-utils              x86_64 7.7-4.el6                 base     86 k
 xulrunner                       x86_64 17.0.10-1.el6.centos      base     14 M
 yelp                            x86_64 2.28.1-17.el6_3           base    813 k
 zenity                          x86_64 2.28.0-1.el6              base    2.6 M

Transaction Summary
================================================================================
Install     233 Package(s)

Total download size: 97 M
Installed size: 304 M
Is this ok [y/N]: y
  

Update a Group of Packages - yum groupupdate groupname


In the example below we are going to update all packages within the group "'X Window System'". In this example, no updates are currently available.



[root@centos01a ~]# yum groupupdate 'X Window System'
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
Package xorg-x11-server-Xorg-1.15.0-36.el6.centos.x86_64 already installed and latest version
Package xorg-x11-xinit-1.0.9-14.el6.x86_64 already installed and latest version
Package 1:xorg-x11-xauth-1.0.2-7.1.el6.x86_64 already installed and latest version
Package xorg-x11-drivers-7.3-13.4.el6.x86_64 already installed and latest version
Package wdaemon-0.17-5.el6.x86_64 already installed and latest version
Package xorg-x11-server-utils-7.7-2.el6.x86_64 already installed and latest version
Package hal-0.5.14-14.el6.x86_64 already installed and latest version
Package plymouth-system-theme-0.8.3-27.el6.centos.1.noarch already installed and latest version
Package xorg-x11-utils-7.5-6.el6.x86_64 already installed and latest version
Package wacomexpresskeys-0.4.2-3.el6.x86_64 already installed and latest version
Package spice-vdagent-0.14.0-9.el6.x86_64 already installed and latest version
Package firstboot-1.110.15-1.el6.x86_64 already installed and latest version
Package glx-utils-10.4.3-1.el6.x86_64 already installed and latest version
Package xvattr-1.3-18.el6.x86_64 already installed and latest version
Warning: Group x11 does not have any packages.
No packages in any requested group available to install or update
  

Remove a Group of Packages - yum groupremove groupname


In the example below we are going to remove a group. To remove the group "X Window System", the command "yum groupremove 'X Window System'" is used. (Please note, if the group package contains spaces within its name, then you must place single quotes around the group name). The output below has been shortened



[root@centos01a ~]# yum groupremove 'X Window System'

Transaction Summary
================================================================================
Remove       63 Package(s)

Installed size: 14 M
Is this ok [y/N]: 
  

Synchronise All Packages - yum distribution-synchronization


"yum distribution-synchronization" will upgrade or downgrade all packages to the latest versions that are available from any enabled repository.



[root@centos01a ~]# yum distribution-synchronization
Loaded plugins: fastestmirror
Setting up Distribution Synchronization Process
Loading mirror speeds from cached hostfile
 * base: mirrors.vooservers.com
 * epel: mirror.serverbeheren.nl
 * extras: repo.bigstepcloud.com
 * updates: repo.bigstepcloud.com
Resolving Dependencies
--> Running transaction check
---> Package openssl.x86_64 0:1.0.1e-42.el6_7.1 will be updated
---> Package openssl.x86_64 0:1.0.1e-42.el6_7.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch           Version                   Repository       Size
================================================================================
Updating:
 openssl         x86_64         1.0.1e-42.el6_7.2         updates         1.5 M

Transaction Summary
================================================================================
Upgrade       1 Package(s)

Total download size: 1.5 M
Is this ok [y/N]: 
  

Displaying Transaction History


Basic Syntax: yum history

The "yum history" command is used to display transactions that have happened in the past.



[root@centos01a ~]# yum history
Loaded plugins: fastestmirror
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    18 | root               | 2016-02-14 12:58 | Update         |    1   
    17 | root               | 2016-02-14 12:55 | Downgrade      |    1   
    16 | root               | 2016-02-14 12:54 | Erase          |   63   
    15 | root               | 2016-02-14 12:37 | Install        |  233   
    14 | root               | 2016-02-14 12:07 | Reinstall      |    1   
    13 | root               | 2016-02-14 12:06 | Reinstall      |    1   
    12 | root               | 2016-02-14 12:05 | Install        |    1   
    11 | root               | 2016-02-14 11:15 | Erase          |    1   
    10 | root               | 2016-02-14 11:14 | Install        |    3   
     9 | root               | 2016-02-14 11:12 | Install        |    1   
     8 | root               | 2016-02-14 11:11 | Erase          |    1   
     7 | root               | 2016-02-14 11:11 | Install        |    1   
     6 | root               | 2016-02-14 10:59 | I, U           |   29   
     5 | root               | 2016-02-01 20:15 | Update         |    1   
     4 | root               | 2015-11-07 21:20 | Update         |    5   
     3 | root               | 2015-10-27 10:07 | Install        |    1   
     2 | root               | 2015-10-25 22:29 | I, U           |   32   
     1 | System            | 2015-10-25 22:23 | Install        |  205   
history list

From the above we can see that there have been 18 changes to this system. We can request information regarding any of the transactions that have been carried out on our system by using the command "yum history info ID". The "ID" is listed in the left hand column.



[root@centos01a ~]# yum history info 9
Loaded plugins: fastestmirror
Transaction ID : 9
Begin time     : Sun Feb 14 11:12:02 2016
Begin rpmdb    : 208:b8f03a2b5b3fa56f7a31d0789830af8bd444af27
End time       :            11:12:03 2016 (1 seconds)
End rpmdb      : 209:30f37f010ddbd1f0d18e353db346d9622e4fd901
User           : root 
Return-Code    : Success
Command Line   : install htop
Transaction performed with:
    Installed     rpm-4.8.0-47.el6.x86_64                       @anaconda-CentOS-201508042137.x86_64/6.7
    Installed     yum-3.2.29-69.el6.centos.noarch               @anaconda-CentOS-201508042137.x86_64/6.7
    Installed     yum-plugin-fastestmirror-1.1.30-30.el6.noarch @anaconda-CentOS-201508042137.x86_64/6.7
Packages Altered:
    Install htop-1.0.1-2.el6.x86_64 @epel
history info

The above is the output from Transaction number 9 (ID 9). From the above we can see that the package htop was installed.


Help with yum - yum --help


Basic Syntax: yum --help

By issuing the "yum --help" command, you can get an overview of all the options that are available under yum. You may also use the man pages for further information.



[root@centos01a ~]# yum --help
Loaded plugins: fastestmirror
Usage: yum [options] COMMAND

List of Commands:

check          Check for problems in the rpmdb
check-update   Check for available package updates
clean          Remove cached data
deplist        List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade      downgrade a package
erase          Remove a package or packages from your system
groupinfo      Display details about a package group
groupinstall   Install the packages in a group on your system
grouplist      List available package groups
groupremove    Remove the packages in a group from your system
help           Display a helpful usage message
history        Display, or use, the transaction history
info           Display details about a package or group of packages
install        Install a package or packages on your system
list           List a package or groups of packages
load-transaction load a saved transaction from filename
makecache      Generate the metadata cache
provides       Find what package provides the given value
reinstall      reinstall a package
repolist       Display the configured software repositories
resolvedep     Determine which package provides the given dependency
search         Search package details for the given string
shell          Run an interactive yum shell
update         Update a package or packages on your system
upgrade        Update packages taking obsoletes into account
version        Display a version for the machine and/or available repos.


Options:
  -h, --help            show this help message and exit
  -t, --tolerant        be tolerant of errors
  -C, --cacheonly       run entirely from system cache, don't update cache
  -c [config file], --config=[config file]
                        config file location
  -R [minutes], --randomwait=[minutes]
                        maximum command wait time
  -d [debug level], --debuglevel=[debug level]
                        debugging output level
  --showduplicates      show duplicates, in repos, in list/search commands
  -e [error level], --errorlevel=[error level]
                        error output level
  --rpmverbosity=[debug level name]
                        debugging output level for rpm
  -q, --quiet           quiet operation
  -v, --verbose         verbose operation
  -y, --assumeyes       answer yes for all questions
  --assumeno            answer no for all questions
  --version             show Yum version and exit
  --installroot=[path]  set install root
  --enablerepo=[repo]   enable one or more repositories (wildcards allowed)
  --disablerepo=[repo]  disable one or more repositories (wildcards allowed)
  -x [package], --exclude=[package]
                        exclude package(s) by name or glob
  --disableexcludes=[repo]
                        disable exclude from main, for a repo or for
                        everything
  --obsoletes           enable obsoletes processing during updates
  --noplugins           disable Yum plugins
  --nogpgcheck          disable gpg signature checking
  --disableplugin=[plugin]
                        disable plugins by name
  --enableplugin=[plugin]
                        enable plugins by name
  --skip-broken         skip packages with depsolving problems
  --color=COLOR         control whether colour is used
  --releasever=RELEASEVER
                        set value of $releasever in yum config and repo files
  --downloadonly        don't update, just download
  --downloaddir=DLDIR   specifies an alternate directory to store packages
  --setopt=SETOPTS      set arbitrary config and repo options