Redhat6更改yum源

最近虚拟机中安装了redhat6.3企业版,自带的yum用不起来,软件都找不到。

网上搜了一下说是没付钱。。。,需要改下yum源。操作步骤如下:


1.切换到yum源存放目录

[root@rhel6 ~]# cd /etc/yum.repos.d/


2.wget方式下载网易Centos yum源

[root@rhel6 yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo


3.修改文件名,备份自带redhat源

[root@rhel6 yum.repos.d]# mv rhel-source.repo rhel-source.repo.bak

[root@rhel6 yum.repos.d]# mv CentOS6-Base-163.repo rhel-source.repo


4.修改repo文件中的版本号

[root@rhel6 yum.repos.d]# sed -i "s;\$releasever;6;g" rhel-source.repo


5.清除原有缓存

[root@rhel6 yum.repos.d]# yum clean all


6.获取yum列表


[root@rhel6 yum.repos.d]# yum makecache



最终效果:









猜你喜欢

转载自blog.csdn.net/indexman/article/details/80640803