
Cheat sheet for working with the package manager Yum (Yellowdog Updater, Modified), which is used in popular Linux distributions: RedHat, CentOS, Scientific Linux (and others). In order to save space, the output of commands is not presented.
Table of contents
TeamsYum optionsYum-Utils PackageConfiguration filesPluginsWork through a proxydisplay commands and options
list of package names from repository
list of all available packages
list of all installed packages
whether the specified package is installed
list of installed and available packages
list of packages related to the kernel
display information about the package
list of dependencies and required packages
find the package that contains the file
package search by name and description
get information about available security updates
list the groups
display the description and contents of the group
installation of the “Basic Web Server” package group
group deletion
Check for available updates
list of connected repositories
information about a specific repository
package information in the specified repository
install all packages from repository
remove packages installed from repository
create cache
check local rpm database (dependencies, duplicates, obsoletes, provides parameters are supported)
view yum history (list of transactions)
viewing information of a specific transaction (installed packages, installed dependencies)
cancel transaction
to repeat
Additionally, you can view the log
remove cached packages
remove all packages and metadata
install package
package removal
upgrade package
upgrade all packages
upgrade to a specific version
install from local directory (search / install dependencies will be made from connected repositories)
or
install from http
roll back to the previous version of the package
reinstall package (recover deleted files)
removing unnecessary more packages
creating local repositories (createrepo is set separately)
installation of updates on a schedule (yum-cron is installed separately)
')
Yum options
answer “yes” when prompted,
-y
answer “no” when prompted
--assumeno
use Yum without plugins
--noplugins
or disable specific plugin
--disableplugin=fastestmirror
enable plugins that are installed but disabled
enable disabled repository
disable repository
download packages but don't install
(on Centos 7 x86_64 will be downloaded to '/ var / cache / yum / x86_64 / 7 / base / packages /')
The following commands are available after installing the yum-utils package.
find from which repository package is installed
find processes whose packages are updated and require restart
request to the repository, find out the dependencies of the package without installing it
synchronize the yum updates repository to the repo1 local directory
check the local repository for integrity
complete transactions
install the necessary dependencies for building the RPM package
configuration options and repositories management yum
query to the local database yum, displaying information about the package
(the command used, the checksum, the URL from which it was set, etc.)
download rpm packages from the repository
download src.rpm package from the repository
(a corresponding repository must be enabled, for example, in '/etc/yum.repos.d/CentOS-Sources.repo' on CentOS)
yumdownloader --source php
Yum configuration files and their location
Main configuration file
/etc/yum.conf
directory with configurations (for example, yum plugins)
/etc/yum/
directory containing information about repositories
/etc/yum.repos.d/
Some options of yum.conf:
Directory where yum stores cache and database files (default is '/ var / cache / yum')
cachedir=/var/cache/yum/$basearch/$releasever
Determines whether or not Yum should keep the header and package cache after successful installation. Values: 0 or 1. (default 1)
keepcache=1
debug output level. Values: 1-10 (default 2)
debuglevel=2
log file (default is '/var/log/yum.log')
logfile=/var/log/yum.log
update obsolete packages
obsoletes=1
verification of package signatures. Values: 0 or 1 (default 1)
gpgcheck=1
inclusion of plugins. Values: 0 or 1 (default 1)
plugins=1
Some useful plugins
Adds a command line option to view the changelog before / after updates.
yum-plugin-changelog
selects faster repositories from the list of mirrors
yum-plugin-fastestmirror
adds the keys, keys-info, keys-data, keys-remove commands that allow you to work with keys.
yum-plugin-keys
block specified packages from updating, yum versionlock command
yum-plugin-versionlock
add yum verify-all, verify-multilib, verify-rpm commands to check packet checksums
yum-plugin-verify
Work Yum through a proxy server
For all users:
add to [main] section in /etc/yum.conf
proxy="http://server:3128"
if necessary, specify a password, add
proxy_proxy_username=user proxy_password=pass
specify proxy for individual user
I will be glad to any additions and comments.
Additionally read: