1.进入yum源配置目录
cd /etc/yum.repos.d
2.配置本地yum源
vi CentOS-Media.repo [c6-media] name=CentOS-$releasever - Media baseurl=file:///mnt file:///media gpgcheck=0 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
3.配置网络yum源
下载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 epel源 wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum install epel-release-6-8.noarch.rpm 或者使用rpm直接安装 rpm –ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 配置好之后,在这个目录下会生成几个.repo文件 [root@node1 yum.repos.d]# ls bak CentOS6-Base-163.repo CentOS-Media.repo epel.repo epel-testing.repo
本文出自 “hello world” 博客,请务必保留此出处http://nxyboy.blog.51cto.com/10511646/1939540
原文地址:http://nxyboy.blog.51cto.com/10511646/1939540