About
yum is a software package manager. It is a tool for installing, updating, and removing packages and their dependencies on RPM-based systems. It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm.
yum is wrapper around rpm.
Features include:
- Support for multiple repositories
- Simple configuration
- Dependency calculation
- Fast operation
- RPM-consistent behavior
- Package group support, including multiple-repository groups
- Simple interface
up2date is now deprecated in favor of yum (Yellowdog Updater Modified). The entire stack of tools which installs and updates software in Red Hat Enterprise Linux 5.2 is now based on yum.
Installation
yum should be already installed but you can install utility command such as the yum-config-manager
yum install yum-utils
Management
For the manipulation of package, see Linux - RPM package (RPM: Red Hat Package Manager)
List installed package
sudo yum list installed
Search packages
sudo yum list searchTerm
Upgrade all package
- Yum Assume yes
yum -y update
- With ansible
- name: 'Upgrade all packages'
yum:
name=*
state=latest
when: ansible_os_family == "RedHat" # Centos
Configuration
/etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
http_caching=packages
Repository
Whatprovides
Search a shared library
Example:
yum whatprovides 'libXrender.so.1'
Output:
Loaded plugins: ulninfo
libXrender-0.9.8-2.1.el7.i686 : X.Org X11 libXrender runtime library
Repo : ol7_latest
Matched from:
Provides : libXrender.so.1
libXrender-0.9.10-1.el7.i686 : X.Org X11 libXrender runtime library
Repo : ol7_latest
Matched from:
Provides : libXrender.so.1
Documentation
For more information on yum:
- you can also use man on a running Fedora system for basic information:
man yum
- The home of the yum project is http://yum.baseurl.org/.