1.进入yum源配置目录
1
|
cd
/etc/yum
.repos.d
|
2.配置本地yum源
1
2
3
4
5
6
7
8
9
|
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源
1
2
|
下载163网易的yum源:
wget http:
//mirrors
.163.com/.help
/CentOS6-Base-163
.repo
|
3.配置好yum源后,执行下边命令更新yum配置,使操作立即生效
yum makecache
4.其他网络yum源
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
中科大的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
|