Yum is easy command to install or update package based from RPM for Centos 5 and latest. yum is an interactive, automated update program which can be used for maintaining systems using rpm.

Usage

yum [options] [command] [package …]

List of Command
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.
List 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
–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 color is used
–releasever=RELEASEVER set value of $releasever in yum config and repo files
–setopt=SETOPTS set arbitrary config and repo options
Sample Command

To update all package already installed on system, use this command:

yum update

Sample Output for this command :

[root@ssh9 ~]# yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: centos.biz.net.id
 * extras: centos.biz.net.id
 * updates: centos.biz.net.id
base                                                                                                         | 3.7 kB     00:00
extras                                                                                                       | 3.5 kB     00:00
updates                                                                                                      | 3.5 kB     00:00
updates/primary_db                                                                                           | 4.3 MB     00:04
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.i686 0:2.6.32-279.19.1.el6 will be installed
---> Package kernel-firmware.noarch 0:2.6.32-279.14.1.el6 will be updated
---> Package kernel-firmware.noarch 0:2.6.32-279.19.1.el6 will be an update
---> Package kernel-headers.i686 0:2.6.32-279.14.1.el6 will be updated
---> Package kernel-headers.i686 0:2.6.32-279.19.1.el6 will be an update
---> Package selinux-policy.noarch 0:3.7.19-155.el6_3.8 will be updated
---> Package selinux-policy.noarch 0:3.7.19-155.el6_3.14 will be an update
---> Package selinux-policy-targeted.noarch 0:3.7.19-155.el6_3.8 will be updated
---> Package selinux-policy-targeted.noarch 0:3.7.19-155.el6_3.14 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                                 Arch                   Version                               Repository               Size
====================================================================================================================================
Installing:
 kernel                                  i686                   2.6.32-279.19.1.el6                   updates                  23 M
Updating:
 kernel-firmware                         noarch                 2.6.32-279.19.1.el6                   updates                 8.7 M
 kernel-headers                          i686                   2.6.32-279.19.1.el6                   updates                 1.9 M
 selinux-policy                          noarch                 3.7.19-155.el6_3.14                   updates                 1.3 M
 selinux-policy-targeted                 noarch                 3.7.19-155.el6_3.14                   updates                 2.6 M

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

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

For update package listing press y. Or you can force yes all question with -y option.
Example:

yum -y update

sample install package
This example show installing apache server and mysql server.

yum install http mysql-server

Output sample :

[root@ssh9 ~]# yum install http mysql-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.biz.net.id
 * extras: centos.biz.net.id
 * updates: centos.biz.net.id
Setting up Install Process
No package http available.
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.i686 0:5.1.66-2.el6_3 will be installed
--> Processing Dependency: mysql = 5.1.66-2.el6_3 for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl-DBI for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(vars) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(strict) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(Sys::Hostname) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(POSIX) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(Getopt::Long) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(File::Temp) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(File::Path) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(File::Copy) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(File::Basename) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(Data::Dumper) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: perl(DBI) for package: mysql-server-5.1.66-2.el6_3.i686
--> Processing Dependency: /usr/bin/perl for package: mysql-server-5.1.66-2.el6_3.i686
--> Running transaction check
---> Package mysql.i686 0:5.1.66-2.el6_3 will be installed
---> Package perl.i686 4:5.10.1-127.el6 will be installed
--> Processing Dependency: perl-libs = 4:5.10.1-127.el6 for package: 4:perl-5.10.1-127.el6.i686
--> Processing Dependency: perl-libs for package: 4:perl-5.10.1-127.el6.i686
--> Processing Dependency: perl(version) for package: 4:perl-5.10.1-127.el6.i686
--> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-127.el6.i686
--> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-127.el6.i686
--> Processing Dependency: libperl.so for package: 4:perl-5.10.1-127.el6.i686
---> Package perl-DBD-MySQL.i686 0:4.013-3.el6 will be installed
---> Package perl-DBI.i686 0:1.609-4.el6 will be installed
--> Running transaction check
---> Package perl-Module-Pluggable.i686 1:3.90-127.el6 will be installed
---> Package perl-Pod-Simple.i686 1:3.13-127.el6 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-127.el6.i686
---> Package perl-libs.i686 4:5.10.1-127.el6 will be installed
---> Package perl-version.i686 3:0.77-127.el6 will be installed
--> Running transaction check
---> Package perl-Pod-Escapes.i686 1:1.04-127.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================
 Package                                      Arch                        Version                                   Repository                      Size
=========================================================================================================================================================
Installing:
 mysql-server                                 i686                        5.1.66-2.el6_3                            updates                        8.8 M
Installing for dependencies:
 mysql                                        i686                        5.1.66-2.el6_3                            updates                        895 k
 perl                                         i686                        4:5.10.1-127.el6                          base                           9.7 M
 perl-DBD-MySQL                               i686                        4.013-3.el6                               base                           134 k
 perl-DBI                                     i686                        1.609-4.el6                               base                           705 k
 perl-Module-Pluggable                        i686                        1:3.90-127.el6                            base                            38 k
 perl-Pod-Escapes                             i686                        1:1.04-127.el6                            base                            30 k
 perl-Pod-Simple                              i686                        1:3.13-127.el6                            base                           210 k
 perl-libs                                    i686                        4:5.10.1-127.el6                          base                           591 k
 perl-version                                 i686                        3:0.77-127.el6                            base                            49 k

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

Total download size: 21 M
Installed size: 59 M
Is this ok [y/N]:

pres y to install all package.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>