yumの仕組みとyumウェアハウスの構築方法



How Yum Works How Build Yum Warehouse



CentOS-Base.repo is the configuration file that will eventually take effect, it is recommended to back up first and then modify it If you want to define a yum repository, you can create a new file ending with repo under /etc/yum.repos.d: ls /etc/yum.repos.d/ CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo The main contents of the configuration file are: [Repository_ID] ——The ID of the warehouse can take any name, as long as it does not conflict with other IDs name = ... ——Descriptive information of the warehouse, the length is not limited, there can be spaces, but it is essential baseurl = url-tell the yum client, which path can be accessed enabled = 0 —— Whether to enable this warehouse, 0 means not enabled, 1 means enabled, the default is enabled gpgcheck = 1 0 ——Whether to check signature validity, 0 means not enabled, 1 means enabled, and enabled by default. If you choose to enable gpg checking, you need to tell what the key is. gpgkey = url ——If gpg detection is enabled, you need to specify the path of gpgkey, even if gpgkey has been imported, Here you still need to manually specify a path for it, this path can be on a remote server, It can also be local, as long as the local client can access it. cost = 1000-The cost of access, which defines cost, and the number with a smaller number, will be given priority access. If the RPM packages in the two warehouses are the same, one on the remote server and the other on the local CD, then the access speed of the local CD is usually faster than the remote Server. In the configuration file, we can define such two warehouses and set the priority for one of them Let's configure a warehouse. In order to avoid other warehouses from disturbing the currently defined warehouse, before configuration, first edit the original CentOS-Base.repo file: [root@xxxxx yum.repos.d]#vim CentOS-Base.repo [base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 # Disable this warehouse [root@xxxxx yum.repos.d]#vim base.repo [base] name=CentOS 6.4 x86_64 baseurl=http://mirror.centos.org/centos/6.5/os/x86_64/ enabled=1 gpgcheck=0

構成されたリポジトリーが正常に使用できるかどうかを確認します。

[root@xxxxx yum.repos.d]#yum list all | less Package name. Platform version Version number-release number @anaconda indicates that the system has been installed, from the yum repository ConsoleKit-libs.x86_64 0.4.1-3.el6 @anaconda-CentOS-201311272149.x86_64/6.5 ConsoleKit-x11.x86_64 0.4.1-3.el6 @anaconda-CentOS-201311272149.x86_64/6.5 apr.i686 1.3.9-5.el6_2 base # base indicates that the program is in the base repository and has not been installed apr-devel.i686 1.3.9-5.el6_2 base apr-devel.x86_64 1.3.9-5.el6_2 base apr-util.i686 1.3.9-3.el6_0.1 base You can use the yum command to view the packages in the repository, indicating that the warehouse has been built.

転載:https://blog.51cto.com/chenshengsheng/2106956