RHEL6.3_X64使用CentOS的yum源

简介:

1、卸载RHEL6自带的yum源

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

2、下载对应的安装包

1
2
3
4
  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
  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
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
13
[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

报错信息与python版本有关

1
2
3
4
[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/1703125,如需转载请自行联系原作者
目录
相关文章
|
2月前
|
缓存
详解CentOS8更换yum源后出现同步仓库缓存失败的问题
详解CentOS8更换yum源后出现同步仓库缓存失败的问题
100 0
|
2月前
|
Linux 应用服务中间件 网络安全
CentOS7搭建本地离线局域网yum源(Httpd/Nginx+yum)
CentOS7搭建本地离线局域网yum源(Httpd/Nginx+yum)
293 0
|
2月前
|
缓存 Linux
Centos7中搭建本地yum源
Centos7中搭建本地yum源
133 0
|
10天前
|
缓存 Linux
linux centos7 挂载本地iso yum源
linux centos7 挂载本地iso yum源
51 0
|
10天前
|
关系型数据库 MySQL Linux
CentOS 7 下使用yum安装MySQL5.7.20 最简单 图文详解
CentOS 7 下使用yum安装MySQL5.7.20 最简单 图文详解
47 0
|
1月前
|
Linux
centOS8不在维护,yum源问题解决
解决执行 yum makecache 出现appstream下载源数据失败问题
64 0
centOS8不在维护,yum源问题解决
|
1月前
|
Linux
linux centos6.8系统配置网络yum源
linux centos6.8系统配置网络yum源
78 0
|
2月前
|
Linux Shell
Linux:centos yum安装指令指南
Linux:centos yum安装指令指南
171 0
Linux:centos yum安装指令指南
|
2月前
|
SQL Linux Shell
centos yum 升级 glibc
在 CentOS 上使用 YUM 升级 GLIBC 库需要谨慎操作,因为 GLIBC 库是系统的基础组件,错误的升级可能导致系统不稳定或与现有应用程序不兼容。 以下是升级 GLIBC 库的步骤: 1. 备份重要数据:在执行任何系统级更改之前,请确保备份重要的数据和配置文件,以防止数据丢失或配置错误。 2. 更新系统:使用 YUM 更新系统软件包,确保系统是最新的稳定版本。可以使用以下命令进行更新: ```sql sudo yum update ``` 3. 备份 GLIBC 库:在升级之前,建议备份当前的 GLIBC 库。可以使用以下命令进行备份: ```bash sudo cp
608 0
|
4月前
|
缓存 Linux
centos7更换yum源 一条命令搞定
centos7更换yum源 一条命令搞定
318 0

热门文章

最新文章