RHEL6.3_X64使用CentOS的yum源
2015-10-15 12:01
330 查看
1、卸载RHEL6自带的yum源
rpm -qa | grep yum |xargs rpm -e --nodeps2、下载对应的安装包
wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm[/code]3、安装软件包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.rpm4、配置新的yum源cd /etc/yum.repos.d/ wget http://mirrors.163.com/.help/CentOS6-Base-163.repo vi CentOS6-Base-163.repo #编辑文件 把文件里面的$releasever全部替换为版本号,即6 最后保存! [base] name=CentOS-6 - Base - 163.com baseurl=http://mirrors.163.com/centos/6/os/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 [updates] name=CentOS-6 - Updates - 163.com baseurl=http://mirrors.163.com/centos/6/updates/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 [extras] name=CentOS-6 - Extras - 163.com baseurl=http://mirrors.163.com/centos/6/extras/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 [centosplus] name=CentOS-6 - Plus - 163.com baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 [contrib] name=CentOS-6 - Contrib - 163.com baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-65、报错信息如下:[root@rhel63 yum.repos.d]# yum makecache There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.6.1 (r261:67515, Oct 8 2014, 19:20:42) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq[/code]报错信息与python版本有关[root@rhel63 ~]# whereis python python: /usr/bin/python2.6 /usr/bin/python2.6-config /usr/bin/python /usr/bin/python.old /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/local/python2.6 /usr/share/man/man1/python.1.gz [root@rhel63 ~]# which yum /usr/bin/yum解决方法:
将“#!/usr/bin/python2.6”修改为“#!/usr/bin/python2.6”
本文出自 “冰冻vs西瓜” 博客,请务必保留此出处http://molewan.blog.51cto.com/287340/1703125
相关文章推荐
- linux下vi命令 修改文件及保存的使用方法
- 解决linux系统CentOS下调整home和根分区大小
- ubuntu下安装keil4,stlink下载配置,stlink linux驱动
- 详解Linux系统中ls和dir命令的组合使用
- linux系统状态命令
- Linux缓存释放
- linux下软件的编译安装
- CentOS6.5连接Wifi详细步骤及常见问题解答
- Linux内核Code Review 001
- dmesg显示开机信息命令详解
- linux yum源配置
- Kali Linux下MySQL设置和重置用户名密码
- 如何在 Arch Linux 中安装 DNSCrypt 和 Unbound
- ElasticSearch在centos中的集群设置
- linux 学习网址
- 如何在 Arch Linux 中安装 DNSCrypt 和 Unbound
- linux下普通用户使用sudo不用输入密码的方法
- Linux下结合inode删除特殊文件
- linux系统的目录及文件汇总表
- 在centos中运行java命令时出现Error: Could not find or load main class XXX问题的解决方法