Centos:yum
url:ftp://172.16.0.1/pub/
Yum:yellow Dog, Yellowdog Update Modifier
Yum Repository:yum Repo
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:///
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 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
The Yum source in the classroom: http://172.16.0.1/cobbler/ks_mirror/CentOS-6.6-x86_64/
CentOS 6.6 x84_64 epel:http://172.16.0.1/fedora-epel/6/x86_64/
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]
Show Packages:
List
# yum list [all | glob_exp1] [GLOB_EXP2] [...]
# Yum list {available|installed|updates} [GLOB_EXP1] [...]
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] [...]
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]
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
http://mirrors.magedu.com/centos/$releasever/$basearch/os
To create a yum repository:
Createrepo [Options] <directory>
Centos-yum Basic Use