首页 > 其他 > 详细

建立自己的Yum源

时间:2014-03-07 17:46:18      阅读:554      评论:0      收藏:0      [点我收藏+]

转自http://kicklinux.com/setup-yum-repos-server/

建立自己的yum服务源

为了节省流量,提高效率,我们在机房内部署了自己的yum server。

安装httpd服务。
同步yum源到/var/www/html/linux下的目录

/usr/bin/rsync -avzL --delete--exclude=SRPMS --exclude=i386 --exclude=isos rsync://mirrors.ustc.edu.cn/centos/6/ /var/www/html/linux/centos/x86_64//usr/bin/rsync -avzL --delete rsync://mirrors.ustc.edu.cn/fedora-epel/6/x86_64 /var/www/html/linux/centos/epel/

北京在线源
    rsync://mirrors.yun-idc.com/centos
    rsync://mirrors.yun-idc.com/epel 
   官方提供的所有镜像站http://www.centos.org/download/mirrors/
 

添加自动化任务,每天夜里自动同步

# vi /var/spool/cron/root 

01***/usr/bin/rsync -avzL --delete--exclude=SRPMS --exclude=i386 --exclude=isos rsync://mirrors.ustc.edu.cn/centos/6/ /var/www/html/linux/centos/x86_64/

01***/usr/bin/rsync -avzL --delete rsync://mirrors.ustc.edu.cn/fedora-epel/6/x86_64 /var/www/html/linux/centos/epel/
# service httpd start

在某一台机器上创建和修改以下文件

[root@vm2 yum.repos.d]# more CentOS-Base.repo # CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client.  You should use this for CentOS updates# unless you are manually picking other mirrors.## If the #mirrorlist= does not work for you, as a fall back you can try the# remarked out baseurl= line instead.##[base]
name=CentOS--Base#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=os
baseurl=http://172.16.1.101/linux/centos/x86_64/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#released updates[updates]
name=CentOS--Updates#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=updates
baseurl=http://172.16.1.101/linux/centos/x86_64/updates/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]
name=CentOS--Extras#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=extras
baseurl=http://172.16.1.101/linux/centos/x86_64/extras/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]
name=CentOS--Plus#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=centosplus
baseurl=http://172.16.1.101/linux/centos/x86_64/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users[contrib]
name=CentOS--Contrib#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=contrib
baseurl=http://172.16.1.101/linux/centos/x86_64/contrib/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6[root@vm2 yum.repos.d]# more epel.repo [epel]
name=ExtraPackagesforEnterpriseLinux6- $basearch
baseurl=http://172.16.1.101/linux/centos/epel/$basearch#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=http://172.16.1.101/linux/centos/epel/RPM-GPG-KEY-EPEL-6[epel-debuginfo]
name=ExtraPackagesforEnterpriseLinux6- $basearch -Debug
baseurl=http://172.16.1.101/linux/centos/epel/$basearch/debug#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=http://172.16.1.101/linux/centos/epel/RPM-GPG-KEY-EPEL-6
gpgcheck=1[epel-source]
name=ExtraPackagesforEnterpriseLinux6- $basearch -Source
baseurl=http://172.16.1.101/linux/centos/epel/SRPMS#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgkey=http://172.16.1.101/linux/centos/epel/RPM-GPG-KEY-EPEL-6
gpgcheck=1

测试一下,一切正常。

建立自己的Yum源,布布扣,bubuko.com

建立自己的Yum源

原文:http://www.cnblogs.com/cmsd/p/3586407.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!