YUM
Yum is the front-section manager of the RPM Package Manager. Yum main function is more convenient to add/remove/update RPM package, automatically solve the dependency problem of the package, easy to manage a large number of system update problems.
The Yum operation is based on the Yum repository
Yum Repository:yum Repo Yum Warehouse
Stores a number of RPM packages, as well as the relevant metadata files for packages (placed in a specific directory: Repodata);
File server:
ftp://
/HTTP
nfs://
file:///
Configuration of Yum
Configuration file
/ETC/YUM.CONF: Providing public configuration for all warehouses
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/A8/wKioL1Xq4syTXJR5AAE7mw8yBZc829.jpg "title=" image 009. PNG "alt=" wkiol1xq4sytxjr5aae7mw8ybzc829.jpg "/>
/etc/yum.repos.d/*.repo: Provides configuration for the point of the warehouse
Definition of Warehouse point:
[Repositoryid]
Name=some name for this repository
baseurl=url://path/to/repository/
Enabled={1|0}
Gpgcheck={1|0}
Gpgkey=url
Enablegroups={1|0}
Failovermethod={roundrobin|priority}
The default is: Roundrobin, meaning random selection;
cost=
Default is 1000
Usage of the Yum command:
Yum [options] [command] [package ...]
command is one of:
* Install Package1 [Package2] [...]
* Update [PACKAGE1] [Package2] [...]
* Update-to [Package1] [Package2] [...]
* Check-update
* upgrade [Package1] [Package2] [...]
* Upgrade-to [Package1] [Package2] [...]
* Distribution-synchronization [Package1] [Package2] [...]
* Remove | Erase Package1 [Package2] [...]
* List [...]
* Info [...]
* provides | Whatprovides Feature1 [Feature2] [...]
* Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]
* Makecache
* Groupinstall group1 [group2] [...]
* Groupupdate group1 [group2] [...]
* grouplist [hidden] [Groupwildcard] [...]
* Groupremove group1 [group2] [...]
* GroupInfo group1 [...]
* Search string1 [string2] [...]
* Shell [filename]
* RESOLVEDEP DEP1 [DEP2] [...]
* Localinstall Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use install)
* Localupdate Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use Update)
* Reinstall Package1 [Package2] [...]
* Downgrade Package1 [Package2] [...]
* Deplist Package1 [Package2] [...]
* Repolist [all|enabled|disabled]
* Version [all | installed | available | group-* | nogroups* | grouplist | groupinfo]
* History [Info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]
* Check
* Help [command]
Show Warehouse list:
repolist [all|enabled|disabled]
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AC/wKiom1Xq5FHio_EpAAGhvtJqWVo668.jpg "title=" image 010. PNG "alt=" wkiom1xq5fhio_epaaghvtjqwvo668.jpg "/>
Show Packages:
List
# yum list [all | glob_exp1] [GLOB_EXP2] [...]
# Yum list {available|installed|updates} [GLOB_EXP1] [...]
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/A8/wKioL1Xq5yPiNS8mAAX8bxTeGmA718.jpg "title=" image 011. PNG "width=" "height=" 353 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px;height:353px; "alt=" Wkiol1xq5ypins8maax8bxtegma718.jpg "/>
To install the package:
Install package1 [Package2] [...]
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/A8/wKioL1Xq8JCiGFcQAASXh481eik051.jpg "title=" image 012. PNG "alt=" wkiol1xq8jcigfcqaasxh481eik051.jpg "/>
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] [...]
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/A8/wKioL1Xq8YTQxwxIAALjHeFELfQ561.jpg "title=" image 013. PNG "alt=" wkiol1xq8ytqxwxiaaljhefelfq561.jpg "/>
To view the package information:
info [...]
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 the capabilities that the specified package depends on:
deplist package1 [Package2] [...]
View Yum Transaction history:
History [Info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/A8/wKioL1Xq81XxXpIxAAEHyMZbU00562.jpg "title=" image 014. PNG "alt=" wkiol1xq81xxxpixaaehymzbu00562.jpg "/>
To install and upgrade the local package:
* Localinstall Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use install)
* Localupdate Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use Update)
Related commands for package group management:
* Groupinstall group1 [group2] [...]
* Groupupdate group1 [group2] [...]
* grouplist [hidden] [Groupwildcard] [...]
* Groupremove group1 [group2] [...]
* GroupInfo group1 [...]
How to use a disc as a local yum repository:
(1) Mount the disc to a directory such as/media/cdrom
# mount-r-T Iso9660/dev/cdrom/media/cdrom
(2) Creating a configuration file
[CentOS7]
name=
baseurl=
gpgcheck=
enabled=
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
Example: http://mirrors.magedu.com/centos/$releasever/$basearch/os
To create a yum repository:
Createrepo [options] <directory>
Linux Learning notes-the Yum of package management