给redhat 6.0配置yum源

来源:互联网 发布:mac能玩qq游戏大厅吗 编辑:程序博客网 时间:2024/06/16 09:15

在网上找的方法,发现源的地址有问题,重新选择了源,搞定~

由于 redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启安装,再配置其他源,以下为详细过程:



1.删除redhat原有的yum
rpm -aq|grep yum|xargs rpm -e --nodeps

2.下载yum安装文件
wget http://ftp.sjtu.edu.cn/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm  
 
wget http://ftp.sjtu.edu.cn/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

wget http://ftp.sjtu.edu.cn/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

wget http://ftp.sjtu.edu.cn/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm  

  


3.进行安装yum

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm  
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm  yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
注意最后两个包必需同时安装,否则会相互依赖

4.更新repo文件

mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.repo.bak

vi /etc/yum.repos.d/rhel-debuginfo.repo

内容为:

[base]
name=CentOS-$releasever - Base
baseurl=http://ftp.sjtu.edu.cn/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://ftp.sjtu.edu.cn/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6

#packages used/produced in the build but not released
#[addons]
#name=CentOS-$releasever - Addons
#baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/addons/$basearch/
#gpgcheck=1
#gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://ftp.sjtu.edu.cn/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://ftp.sjtu.edu.cn/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0

5、yum clean all

6、yum install vim #测试一下可不可以用
原创粉丝点击