文章目录

安装epel yum-downloadonly

rpm -Uvh http://mirrors.sohu.com/fedora-epel/5Server/i386/epel-release-5-4.noarch.rpm
ftp://zid-luxinst.uibk.ac.at/pub/dist/centos/5/os/x86_64/CentOS/yum-downloadonly-1.1.16-14.el5.centos.1.noarch.rpm
yum install yum-downloadonly nginx createrepo 

创建仓库目录
mkdir -pv /data/mirrors/centos/5/{os,updates}/i386

下载相关软件包

yum install git tcl-devel  -y --downloadonly \
--downloaddir=/data1/mirrors/centos/5/updates/i386/RPMS/

yum install autoconf automake libtool gcc-c++ glibc-devel openssl-devel tcl-devel expat-devel sqlite-devel pcre-devel \
-y --downloadonly --downloaddir=/data1/mirrors/centos/5/updates/i386/RPMS/

创建repo文件

createrepo /data/mirrors/centos/5/updates/i386

client配置属于你自己的repo
vim /etc/yum.repo.d/bubbyroom.repo

[base]
name=CentOS-$releasever -Base
baseurl=http://mirrors.bubbyroom.com/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates [updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.bubbyroom.com/centos/$releasever/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

yum clean all

yum update

如果想同步官方的镜像可以采用如下类似的命令
rsync -av rsync://yum.puppetlabs.com/ ./

文章目录