RHEL6使用CentOS的yum源

简介:

1、卸载RHEL6自带的yum源

1
rpm -qa |  grep  yum | xargs  rpm -e --nodeps

 

2、下载对应的安装包

1
2
3
4
5
6
7
8
9
10
11
# 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


 
3、安装软件包 

1
2
3
4
5
  # 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、配置新的yum源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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-6

 

5、报错信息如下:

1
2
3
4
5
6
7
8
9
10
11
12
# 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:

报错信息与python版本有关

1
2
3
4
5
[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西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1674134,如需转载请自行联系原作者
目录
相关文章
|
安全 关系型数据库 MySQL
CentOS 7 yum 安装 MySQL教程
在CentOS 7上安装MySQL 8,其实流程很清晰。首先通过官方Yum仓库来安装服务,然后启动并设为开机自启。最重要的环节是首次安全设置:需要先从日志里找到临时密码来登录,再修改成你自己的密码,并为远程连接创建用户和授权。最后,也别忘了在服务器防火墙上放行3306端口,这样远程才能连上。
3111 16
|
Linux
Centos6配置阿里云yum源报错
在CentOS 6配置阿里云Yum源时,可能出现EPEL仓库访问报错(404 Not Found)。解决方法:编辑`/etc/yum.repos.d/epel.repo`文件,将`enabled`和`gpgcheck`参数设为0 ``` 此设置可解决仓库无法访问的问题。
2718 29
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
2036 25
|
缓存 Linux
CentOS-6的iso下载地址镜像yum源
通过上述步骤,您可以成功下载CentOS 6的ISO镜像文件,并配置适用于CentOS 6的YUM源。尽管CentOS 6已经停止更新,但使用这些镜像和YUM源配置,可以继续在需要的环境中使用和维护CentOS 6系统。
9496 20
|
Linux 虚拟化 开发者
一键将CentOs的yum源更换为国内阿里yum源
一键将CentOs的yum源更换为国内阿里yum源
24568 31
CentOs9 yum源出现404问题
CentOs9-stream yum源出现404问题
|
缓存 Linux
解决CentOS 7停止更新后yum源失效问题【图文教程】
以上步骤完成后,你的 CentOS 7 系统就会使用阿里云的 yum 源,更换yum以后就可以正常使用啦。
16902 2
|
存储 关系型数据库 MySQL
MySQL介绍和MySQL包安装 -- RHEL系列(Yum资源库安装MySQL)
MySQL是一款开源关系型数据库,高性能、易用、跨平台,支持多种存储引擎,广泛应用于Web开发、企业级应用等领域。本教程介绍其特点、架构及在主流Linux系统中的安装配置方法。
1764 0
MySQL介绍和MySQL包安装 -- RHEL系列(Yum资源库安装MySQL)
|
缓存 Ubuntu 前端开发
yum的安装和使用(包含安装过程中遇到的问题及解决方法)
yum的安装和使用(包含安装过程中遇到的问题及解决方法)
2202 1
yum的安装和使用(包含安装过程中遇到的问题及解决方法)
|
监控 Linux
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
927 13
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡