1 安装 createrepo-0.4.11-3.el5.noarch.rpm
#rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
2 创建yum数据库
#createrepo /yum/server
3 修改 /etc/yum.conf
gpgcheck=0 //本地一般不需要设置该选项
installonly_limit = 5
4 编辑 CentOS-Base.repo,设置rpm安装包 源库位置
[base]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=file:///yum/server
enabled=1 --其他没用选项应设置为0
5 启动验证
#yum clean all
6 检查yum组件配置
#yum repolist all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id repo name status
addons CentOS-5 - Addons disabled
base CentOS-5 - Base enabled: 3,392
c5-media CentOS-5 - Media disabled
centosplus CentOS-5 - Plus disabled
contrib CentOS-5 - Contrib disabled
extras CentOS-5 - Extras disabled
updates CentOS-5 - Updates enabled: 3,392
repolist: 6,784
转载于:https://www.cnblogs.com/longer3281/p/8776877.html