1. Protocols Supported by yum
FTP ftp: // server/path/to/Repo
HTTP http: // server/path/to/Repo
File file: // path/to/Repo
NFS: // server/path/to/Repo
2. configuration files of the yum Client
/Etc/yum. conf Yum main configuration file
/Etc/yum. Repos. d/Yum repository configuration file storage directory
/Etc/Yum plug-in and other related configuration storage Directories
Basic Format and parameter examples of the yum repository configuration file:
[Repo_id]
Name = string
Baseurl = repository access path
Enabled = {1 | 0}
Gpgcheck = {1 | 0}
Gpgkey = Public Key File (either local or server path)
Cost = defines the warehouse overhead. The default value is 1000.
Note: "repo_id" is the ID of a specific Yum repository, so it cannot be the same as that of other Yum repositories. Otherwise, multiple warehouses with the same name will only be recognized to load one of them!
3. Common Yum lifeLing
Common commands of Yum [Options] command are as follows:
Repolist [All | enabled | disabled] lists all available Yum repo.
List [All | installed | available] to list RPM packages. Installed indicates that installed items are listed, and available indicates available and installable items in the yum repository.
Info package_name lists the package description.
Grouplist: list all Groups
Groupinfo "package_group_name" displays package group information
Install package_name... install the package with the specified package name
Groupinstall "group_name" installs the specified package group. Examples of common development packages:
Centos5 "development tools" and "development libraries"
Centos6 "development tools" and "server platform development"
Reinstall package_name... reinstall the specified package
Check-Update: Check the packages that can be upgraded
Update package_name... update the package to the specified version. For example, the current bash installation package is Bash-1.2.1, and there are available upgrade packages bash-1.2.2 and bash-1.2.3. If you want to upgrade to version 1.2.2:
Rpm update bash-1.2.2
If you do not specify the specific version number of the package, the package will be upgraded to the latest available version by default.
Downgrade package_name downgrade the specified package
Erase package_name... Delete the package with the specified package name
Groupremove "group_name" detaches a group with the specified package group name
Clean [All | packages | metadata | expire-Cache | rpmdb | plugins] Clear Cache
Whatprovides | provides/path/to/somefile
In addition, yum can directly install the local RPM package:
Yum install/path/to/package_file
Example: Yum install/tmp/zsh-2.3.1-2.el6.x86_64.rpm -- nogpgcheck
The -- nogpgcheck option indicates that the source validity and integrity of the installation package are not checked.
4. Four available Macros in the yum configuration file
$ Releasever: The program version. For yum, it refers to the RedHat-release version. It is only replaced with the main version. For example, RedHat 6.5, it is replaced with 6.
$ Arch: system architecture, such as x86_64, x86, PPC
$ Basearch: the basic architecture of the system, such as i686 and i586, is i386.
$ YUM0-9: environment variables defined in the system, which can be used in yum
5. Example of creating a yum server package Repository
A) preparations. Install createrepo and httpd on the yum Server
B) create a directory under the/var/www/html directory. Assume that the directory is named "my_yum_repos" and put all the RPM package files under the directory.
C) Create a yum Repository
# Createrepo/var/www/html/my_yum_repos
This command will create a "repodata" directory under the my_yum_repos directory, where all metadata files related to the repository are located.
D) Start the HTTPd service.
Service httpd start
At this point, a yum repository source that can provide external services is created and configured!
This article is from the blog of "bee Huai Yu Shan Ren", please be sure to keep this http://deshanrenjian.blog.51cto.com/9324633/1551073
Package Manager-yum