Yum (Yellowdog Updater Modified) is an interactive, automated update program which can be used for maintaining systems using rpm by super users (root). It is used to check, install, remove or update to the latest version of a package or group of packages while ensuring that all dependencies are satisfied. Login as the root user to install and update the system.
WARNING! yum command only works with RHEL / CentOS Linux version 5.x or above. For RHEL 4.x and older version use up2date command.
Register my system with RHN
To register your system with RHN type the following command and just follow on screen instructions (CentOS user skip to next step):
rhn_register
- Viewing yum options:
yum -h
- List all installed packages:
rpm -qa yum list installed yum list |more
- Search for packages by name (e.g. Search httpd and all matching perl packages):
yum list httpd yum list perl*
- Check if a package is installed (e.g. httpd):
rpm -qa | grep httpd* yum list installed httpd
- Get detailed package descriptions (e.g. description of httpd package):
yum info httpd
- View package dependencies. Most packages that come with a Linux distribution contain one or more dependencies. (e.g. httpd has openssl, zlib or PHP package)
yum deplist httpd
- Check for new package versions:
yum list updates yum check-update
- Update all of the outdated packages to newest versions.
yum update
- Check and update specified package (e.g. httpd):
yum update httpd
- Install specified packages [ RPM(s) ] (e.g. httpd & mssql):
yum install httpd mssql
- Remove / Uninstall the specified packages [ RPM(s) ] (e.g. httpd)
yum remove httpd
- Display the list of available packages:
yum list all
- Display list of group software:
yum grouplist
Output will list a) Installed Groups and b) Available Groups - Install all the default packages by group (e.g. Install all 'Development Tools' group packages):
yum groupinstall "Development Tools"
- Update all the default packages by group (e.g. Update all 'Development Tools' group packages):
yum groupupdate "Development Tools"
- Remove all packages in a group (e.g. Remove all 'Development Tools' group packages):
yum groupremove "Development Tools"
- Install particular architecture package (e.g. If you are using 64 bit RHEL version it is possible to install 32 packages:
yum install {package-name}.{architecture} yum install mysql.i386
- Display packages not installed via official RHN subscribed channels or repositories: (e.g. dag on CentOS)
yum list extras
- Search all packages to find the one which holds the specified file e.g. if you are trying to figure out what you need to install to use bunzip2, type:
yum provides bunzip2 yum whatprovides bunzip2
or find out what provides the /etc/yum.conf file:
yum provides /etc/yum.conf yum whatprovides /etc/yum.conf
Sample output:
... yum.noarch 2.4.0-0.fc4 installed Matched from: /etc/yum.conf
This example shows that /etc/yum.conf is part of the yum.noarch package. - You can use same command to list packages that satisfy dependencies:
yum whatprovides {dependency-1} {dependency-2}
- Cleaning up the yum cache. The yum package manager maintains a cache of headers and files in /var/cache/yum. This cache can grow rather large over time, and can be cleaned with the yum "clean" option:
yum clean all
- Refer to the yum command man page for more information:
man yum
No comments:
Post a Comment