首页 > 代码库 > centos 建立自己的本地源服务器

centos 建立自己的本地源服务器

首先建立站点,httpd或nginx都可,我的站点根目录指向“/var/www/centos/”


然后下载源,并同步源

rsync -avrt rsync://mirrors.ustc.edu.cn/centos/6.5/updates/x86_64/ /opt/centos/other/updates/

rsync -avrt rsync://mirrors.ustc.edu.cn/centos/6.5/extras/x86_64/ /opt/centos/other/extras/

rsync -avrt rsync://mirrors.ustc.edu.cn/centos/6.5/centosplus/x86_64/ /opt/centos/other/centosplus/

rsync -avrt rsync://mirrors.ustc.edu.cn/centos/6.5/contrib/x86_64/ /opt/centos/other/contrib/

我这有一份最新的源(2014-7-18号更新)适用于centos 6 64位

下载地址


替换客户端的CentOS-Base.repo

[base]

name=CentOS-6 - Base - hnkj

baseurl=http://站点IP/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://站点IP/RPM-GPG-KEY-CentOS-6


#released updates 

[updates]

name=CentOS-6 - Updates - hnkj

baseurl=http://站点IP/other/updates/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://站点IP/RPM-GPG-KEY-CentOS-6


#additional packages that may be useful

[extras]

name=CentOS-6 - Extras - hnkj

baseurl=http://站点IP/other/extras/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://站点IP/RPM-GPG-KEY-CentOS-6


#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-6 - Plus - hnkj

baseurl=http://站点IP/other/centosplus/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://站点IP/RPM-GPG-KEY-CentOS-6


#contrib - packages by Centos Users

[contrib]

name=CentOS-6 - Contrib - hnkj

baseurl=http://站点IP/other/contrib/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://站点IP/RPM-GPG-KEY-CentOS-6


centos 建立自己的本地源服务器