更新CentOS源
添加163+网易源使用如下方法:
首先备份/etc/yum.repos.d/CentOS-Base.repo
Mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
当然更简单的办法是wget
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
wget http://mirrors.sohu.com/help/CentO6-Base-sohu.repo
然后运行yum makecache生成缓存
最后安装好第三方源时记得 更新yum软件包
yum check-update
四、CentOS 6.X 安装使用EPEL YUM源
1. 查看操作系统版本
|
1
2
3
4
5
|
[root@node1 ~]# uname -aLinux node1.test.com 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux[root@node1 ~]# cat /etc/issueCentOS release 6.4 (Final)Kernel \r on an \m |
2.下载相应的EPEL源
(1).32位系统
|
1
|
[root@node1 src]# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm |
(1).64位系统
|
1
|
[root@node1 ~]# http://mirrors.hust.edu.cn/epel//6/x86_64/epel-release-6-8.noarch.rpm |
3.安装EPEL源(注:我这里是64位系统)
|
1
2
3
4
|
[root@node1 src]# rpm -ivh epel-release-6-8.noarch.rpmwarning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEYPreparing... ########################################### [100%] 1:epel-release ########################################### [100%] |
4.导入key文件
|
1
|
[root@node1 src]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 |
5.查看安装的EPEL源
|
1
2
3
4
5
6
7
8
9
|
[root@node1 src]# cd /etc/yum.repos.d/[root@node1 yum.repos.d]# ll总用量 24-rw-r--r--. 1 root root 1926 2月 25 16:57 CentOS-Base.repo-rw-r--r--. 1 root root 638 2月 25 16:57 CentOS-Debuginfo.repo-rw-r--r--. 1 root root 623 7月 25 16:57 CentOS-Media.repo-rw-r--r--. 1 root root 3664 2月 25 16:57 CentOS-Vault.repo-rw-r--r-- 1 root root 957 11月 5 2012 epel.repo-rw-r--r-- 1 root root 1056 11月 5 2012 epel-testing.repo |
6.测试
|
1
2
|
[root@localhost yum.repos.d]# yum clean all[root@node1 yum.repos.d]# yum list |

浙公网安备 33010602011771号