Objective
First of all, specifically, Yum is just to solve the problem of RPM dependencies, rather than a different software installation mode. Although in the CentOS can directly use the Yum source, but also exists with the external network isolation of the status quo, so need to build a local Yum source, below to see the detailed method.
System: CentOS 6.5
1. Mount the disc under/MNT
2, delete the system from the repo file
# cd/etc/yum.repos.d/#
mkdir bak
# mv *.repo Bak
3, install Createrepo(in fact, as long as the installation of Createrepo can be, but need other dependencies, so also have to install)
# cd/mnt/packages/#
RPM-IVH libxml2-python-2.7.6-14.el6.x86_64.rpm #
RPM-IVH deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
# RPM-IVH python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
# RPM-IVH createrepo-0.9.9-18.el6.noarch.rpm
4, use the Createrepo command to create the Yum Warehouse, create INDEX information
Note: Here we set up the Yum warehouse in/doiido/local
# mkdir/doiido/local #
cp-rv/mnt/packages/*/doiido/local #
cd/doiido/local
# createrepo-v/doiido/local
5, if need to group information
# cp/mnt/repodata/b4e0b9342ef85d3059ff095fa7f140f654c2cb492837de689a58c581207d9632-c6-x86_64-comps.xml/doiido/ Local/comps.xml
# createrepo-g/doiido/local/comps.xml/doiido/local
6. Edit your own repo files
# Vi/etc/yum.repos.d/local.repo
#库名称
[local_server]
#名称描述
name=thisis a local repo
# Yum Source directory
baseurl=file:///doiido/local
#是否启用该yum源, 0 for disabled
enabled=1
#检查GPG-key (0 for no check, 1 for check)
Gpgcheck=0
7. Load Yum Cache
# yum Clean all
# yum Makecache
8. Test download
Here you can see that you can install PHP directly without having to download it online.
Summarize
The above is in the CentOS system to build a local Yum server method, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange.