What is Yum?
Yum (full name Yellow dog Updater, Modified) is a Shell Front end Package Manager in Fedora and Redhat and CentOS. Based on rpm package management, can automatically download RPM package from the specified server and install, can automatically handle the dependency relationship, and install all dependent packages at once, without tedious downloading, installing
Why use Yum?
when using RPM to install the package, there will be program dependency requirements, then the program installation sequence is more important, and Yum is the front end of the RPM tool, can automatically determine dependencies, user-friendly installation
How do I use yum?
Configuring the Yum client
Configuration file:
/etc/yum.conf: Providing public configuration for all warehouses
/etc/yum.repos.d/*.repo: Provides configuration for the point of the warehouse
Definition of Warehouse
[warehouse ID]
Name= Warehouse Full Name
Baseurl= the URL of the warehouse access (can be multiple)
ENABLED={1|0} whether the warehouse is enabled
Gpgcheck={1|0} whether to check package integrity and source legitimacy
Gpgkey=url indicates the key file location
ENABLEGROUPS={1|0} whether the group is supported
Failovermethod={roundrobin|priority} How to access the warehouse URL (random, priority)
Cost= overhead (default 1000)
use of the yum command:
Yum [options] [command] [package ...]
Show Warehouse list:
Repolist [all|enabled|disabled]
To install the package:
Install Package1 [Package2] [...]
Reinstall Package1 [Package2] [...] (reinstall)
Upgrade Package:
Update [PACKAGE1] [Package2] [...]
Downgrade Package1 [Package2] [...] Downgrade
Check for available upgrades:
Check-update
To uninstall a package:
Remove | Erase Package1 [Package2] [...]
View which package is provided by the specified attribute (which can be a file):
provides | Whatprovides Feature1 [Feature2] [...]
To clean up the local cache:
Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]
Build cache:
Makecache
Search:
Search string1 [string2] [...]
Search for the package name and summary information with the specified keywords;
View Yum Transaction history:
History [Info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]
Related commands for package group management:
* Groupinstall group1 [group2] [...]
* Groupupdate group1 [group2] [...]
* grouplist [hidden] [Groupwildcard] [...]
* Groupremove group1 [group2] [...]
* GroupInfo group1 [...]
Yum command-line Options :
--nogpgcheck: No GPG check is allowed;
-Y: Auto Answer "yes";
-Q: Silent mode;
--disablerepo=repoidglob: Temporarily disables the repo specified here;
--enablerepo=repoidglob: Temporarily enable the repo specified here;
--noplugins: Disable all plugins;
The variables available in the Yum repo configuration file :
$releasever: The major version number of the current OS release version;
$arch: platform;
$basearch: Basic platform;
$YUM 0-$YUM 9
http://mirrors.magedu.com/centos/$releasever/$basearch/os
To create a yum repository:
Createrepo [Options] <directory>
Linux System Management-(9)-yum Tools