对Yum源的一些优化配置

时间:2015-07-10 13:00:37 魔新豆网

  设置163源
网易(163)yum源是国内最好的yum源之一 ,无论是速度还是软件版本,都非常的不错,将yum源设置为163yum,可以提升软件包安装和更新的速度,同时避免一些常见软件版本无法找到。具体设置方法如下:
1,进入yum源配置目录

  

  复制代码

代码如下:

  cd /etc/yum.repos.d


2,备份系统自带的yum源

  

  复制代码

代码如下:

  mv CentOS-Base.repo CentOS-Base.repo.bk


下载163网易的yum源:

  

  复制代码

代码如下:

  wget http://mirrors.163.com/.help/CentOS6-Base-163.repo


3,更新玩yum源后,执行下边命令更新yum配置,使操作立即生效

  

  复制代码

代码如下:

  yum makecache


4,除了网易之外,国内还有其他不错的yum源,比如中科大和搜狐的,大家可以根据自己需求下载
中科大的yum源:

  

  复制代码

代码如下:

  wget http://centos.ustc.edu.cn/CentOS-Base.repo


sohu的yum源

  

  复制代码

代码如下:

  wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo


理论上讲,这些yum源redhat系统以及fedora也是可以用 的,但是没有经过测试,需要的站长可以自己测试一下。

  
使用Cobbler搭建自己的yum源
Cobbler使用介绍:
进入cobller界面,点击”Repos”,新建Repo“create new repo”,我这里已经创建好了4个yum源,下拉go旁边的选项,选中“Reposync”,勾选repo项目,可进行yum源同步。

  cobbler创建yum源原理很简单,就是把外面的yum源同步过来,所以下面配置repo项目的时候,”mirror”项填选可用的yum源即可,执行Reposync时,cobbler就会把外面的软件包同步过来。

  这里我们架构”Arch”选择x86_64(64位系统),种类”Breed”选择”yum”;”mirror”项填选外部yum源。

  我用的是阿里云的yum源

  

  复制代码

代码如下:

  CentOS-Base:http://mirrors.aliyun.com/centos/6/os/x86_64/
CentOS-updates:http://mirrors.aliyun.com/centos/6/updates/x86_64/
CentOS-extras:http://mirrors.aliyun.com/centos/6/extras/x86_64/
Centos-epel:http://mirrors.aiyun.com/epel/6/x86_64/

  由于更新的软件包较大,我单独挂载了一块磁盘 把它link到/var/www/cobbler/repo_mirror/(yum源软件存放的目录)

  

  

  复制代码

代码如下:

  # 创建一个CentOS-Base.repo文件(把他放到/var/www/cobbler/ks_mirror/mirror_name上面(mirro_name是你建的镜像源的名字),这样服务器就能下载使用了)
[core-0]
name=core
baseurl=http://192.168.6.170/cobbler/ks_mirror/Centos6.4_mini-x86_64/
enabled=1
gpgcheck=0
priority=1

[centos6.4-x86_64-base]
name=centos6.4-x86_64-base
baseurl=http://192.168.6.170/cobbler/repo_mirror/Centos6.4-x86_64-base/
enabled=1
priority=99
gpgcheck=0

[centos6.4-x86_64-updates]
name=centos6.4-x86_64-update
baseurl=http://192.168.6.170/cobbler/repo_mirror/Centos6.4-x86_64-update/
enabled=1
priority=99
gpgcheck=0


[centos6.4-x86_64-extras]
name=centos6.4-x86_64-extras
baseurl=http://192.168.6.170/cobbler/repo_mirror/Centos6.4-x86_64-extras/
enabled=1
priority=99
gpgcheck=0


[centos6.4-x86_64-epel]
name=centos6.4-x86_64-epel
baseurl=http://192.168.6.170/cobbler/repo_mirror/Centos6.4-x86_64-epel/
enabled=1
priority=99
gpgcheck=0

  对Yum源的一些优化配置

  对Yum源的一些优化配置

  对Yum源的一些优化配置

本文标签:
读过此篇文章的网友还读过: