Administration toolsCommands

How to use YUM (Yellowdog Updater, Modified) command on RHEL/CentOS, Fedora Linux

YUM (Yellowdog Updater Modified) is an open source command-line package management tool for RPM (RedHat Package Manager) based Linux systems. YUM developed Seth Vidal under GPL (General Public License).

Install software package using yum command

To install package (example Firefox) run command in your terminall:

# yum install firefox

This command will also identify the dependencies automatically and install them.
By default ‘yum install’, will prompt you to accept or decline before installing the packages. If you want yum to install automatically without prompting, use -y option as shown below.

# yum install firefox -y

Uninstall software package using yum remove command

To remove all packages wich all dependencies run following command:

# yum remove firefox

To disable confirmation prompt just add option -y in command.

# yum remove firefox -y

Update package using YUM

If you have a older version of a package, use yum update to upgrade it to the latest current version.

# yum update packagename

Search package using YUM

If you don’t know the exact package name to be installed, use yum search keyword.
Example:

# yum search firefox
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink                                            |  24 kB     00:00     
 * base: ftp.funet.fi
 * epel: mirror.imt-systems.com
 * extras: ftp.funet.fi
 * updates: ftp.funet.fi
base                                                     | 3.7 kB     00:00     
epel                                                     | 4.2 kB     00:00     
epel/primary_db                                          | 4.7 MB     00:00     
extras                                                   | 3.5 kB     00:00     
updates                                                  | 3.4 kB     00:00     
updates/primary_db                                       | 4.2 MB     00:02     
epel/pkgtags                                             | 614 kB     00:00     
============================= N/S Matched: firefox =============================
firefox.i686 : Mozilla Firefox Web browser
mozilla-adblockplus.noarch : Adblocking extension for Mozilla Firefox,
                           : Thunderbird, and SeaMonkey
mozilla-https-everywhere.noarch : HTTPS/HSTS enforcement extension for Mozilla
                                : Firefox and SeaMonkey
mozilla-noscript.noarch : JavaScript white list extension for Mozilla Firefox
nspluginwrapper.i686 : A compatibility layer for Netscape 4 plugins
python-mozrunner.noarch : Reliable start/stop/configuration of Mozilla
                        : Applications (Firefox, Thunderbird)

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

List a Package using YUM

The following command will list all the packages available in the yum database

# yum list |less
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.funet.fi
 * epel: be.mirror.eurid.eu
 * extras: ftp.funet.fi
 * updates: ftp.funet.fi
Installed Packages
MAKEDEV.i686                            3.24-6.el6                     @base    
acl.i686                                2.2.49-6.el6                   @base    
acpid.i686                              1.0.10-2.1.el6                 @base    
attr.i686                               2.4.44-7.el6                   @base    
audit.i686                              2.2-2.el6                      @base    
audit-libs.i686                         2.2-2.el6                      installed
authconfig.i686                         6.1.12-13.el6                  @base    
basesystem.noarch                       10.0-4.el6                     installed
bash.i686                               4.1.2-15.el6_4                 @updates 
bind.i686                               32:9.8.2-0.17.rc1.el6_4.6      @updates 
bind-libs.i686                          32:9.8.2-0.17.rc1.el6_4.6      @updates 
binutils.i686                           2.20.51.0.2-5.36.el6           @base    
bzip2.i686                              1.0.5-7.el6_0                  @base    
bzip2-libs.i686                         1.0.5-7.el6_0                  installed
............

To view all the packages that are installed on your system, execute the following yum command:

# yum list installed |less

Loaded plugins: fastestmirror
Installed Packages
MAKEDEV.i686                          3.24-6.el6                       @base    
acl.i686                              2.2.49-6.el6                     @base    
acpid.i686                            1.0.10-2.1.el6                   @base    
attr.i686                             2.4.44-7.el6                     @base    
audit.i686                            2.2-2.el6                        @base    
audit-libs.i686                       2.2-2.el6                        installed
authconfig.i686                       6.1.12-13.el6                    @base    
basesystem.noarch                     10.0-4.el6                       installed
bash.i686                             4.1.2-15.el6_4                   @updates 
bind.i686                             32:9.8.2-0.17.rc1.el6_4.6        @updates 
bind-libs.i686                        32:9.8.2-0.17.rc1.el6_4.6        @updates 
binutils.i686                         2.20.51.0.2-5.36.el6             @base    
bzip2.i686                            1.0.5-7.el6_0                    @base    
bzip2-libs.i686                       1.0.5-7.el6_0                    installed
ca-certificates.noarch                2010.63-3.el6_1.5                installed
centos-release.i686                   6-4.el6.centos.10                installed
checkpolicy.i686                      2.0.22-1.el6                     @base    
chkconfig.i686                        1.3.49.3-2.el6_4.1               @updates 
coreutils.i686                        8.4-19.el6_4.2                   @updates 
.....................

Use the yum list command to search for the specific package with name:

# yum list firefox
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.funet.fi
 * epel: epel.mirror.nucleus.be
 * extras: ftp.funet.fi
 * updates: ftp.funet.fi
Available Packages
firefox.i686                     17.0.9-1.el6.centos                     updates

Information of 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.

# yum info firefox
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.academica.fi
 * epel: mirror.nl.leaseweb.net
 * extras: mirror.academica.fi
 * updates: mirror.academica.fi
Available Packages
Name        : firefox
Arch        : i686
Version     : 17.0.9
Release     : 1.el6.centos
Size        : 25 M
Repo        : updates
Summary     : Mozilla Firefox Web browser
URL         : http://www.mozilla.org/projects/firefox/
License     : MPLv1.1 or GPLv2+ or LGPLv2+
Description : Mozilla Firefox is an open-source web browser, designed for
            : standards compliance, performance and portability.

List all Available Packages using YUM command

To list all the available packages in the Yum database using following command:

# yum list | less

Check for available updates using Yum

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

# yum check-update

Update System using Yum

To keep your system up-to-date with all security and binary package updates, run the following command.

# yum update

Example:

# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos-mirror.rbc.ru
 * epel: mirror.nl.leaseweb.net
 * extras: centos-mirror.rbc.ru
 * updates: centos-mirror.rbc.ru
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package ajenti.noarch 0:1.1.4-1 will be updated
---> Package ajenti.noarch 0:1.1.8.1-1 will be an update
--> Processing Dependency: python-ldap for package: ajenti-1.1.8.1-1.noarch
---> Package glibc.i686 0:2.12-1.107.el6_4.4 will be updated
---> Package glibc.i686 0:2.12-1.107.el6_4.5 will be an update
---> Package glibc-common.i686 0:2.12-1.107.el6_4.4 will be updated
---> Package glibc-common.i686 0:2.12-1.107.el6_4.5 will be an update
---> Package reconfigure.noarch 0:0.1.33-1 will be updated
---> Package reconfigure.noarch 0:0.1.34-1 will be an update
--> Running transaction check
---> Package python-ldap.i686 0:2.3.10-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch         Version                    Repository     Size
================================================================================
Updating:
 ajenti             noarch       1.1.8.1-1                  ajenti        1.2 M
 glibc              i686         2.12-1.107.el6_4.5         updates       4.3 M
 glibc-common       i686         2.12-1.107.el6_4.5         updates        14 M
 reconfigure        noarch       0.1.34-1                   ajenti         96 k
Installing for dependencies:
 python-ldap        i686         2.3.10-1.el6               base          124 k

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

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

List available group packages using YUM

To view all the available software groups execute yum grouplist command

Yum grouplist command output
Yum grouplist command output

Install a Group Packages using YUM command

To install specific software group, use groupinstall option:

#  yum groupinstall 'FTP server'
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.yandex.ru
 * epel: mirror.nl.leaseweb.net
 * extras: mirror.yandex.ru
 * updates: mirror.yandex.ru
Setting up Group Process
Checking for new repos for mirrors
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.i686 0:2.2.2-11.el6_4.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch          Version                   Repository        Size
================================================================================
Installing:
 vsftpd          i686          2.2.2-11.el6_4.1          updates          157 k

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

Total download size: 157 k
Installed size: 344 k
Is this ok [y/N]:

Update a Group Packages using YUM command

To update any existing installed group packages run following command:

# yum groupupdate 'FTP server'

Remove a Group Packages

To delete or remove any existing installed group from the system use command:

# yum groupremove 'FTP server'

If anything related to yum commands may have missed out. Please update list of YUM command using comment box.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close