|
1.问题:
公司有一台服务器,因为一直用的是centos的系统,但是那个分中心没有现成centos的系统,问我红帽5.3的能行吗?我说试一试,然后在配置yum源的时候就遇到了问题,提示如下错误。这是因为这个系统没有在红帽注册,所以不能用yum。
1
2
3
4
5
| [iyunv@localhost ~]# yum repolist
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
repolist: 0
|
2.解决:
红帽和centos的区别基本就是开源与不开源,虽然红帽定位于商用,centos定位于家用,但是很多企业为了节省成本,仍使用centos。但是用的也很好。所以基本上他们两的yum源是可以互用的。所以找到自己对应版本的centos yum装上就可以了
3.步骤:
3.1查看原有的yum
1
2
3
4
5
6
| [iyunv@localhost yum.repos.d]# rpm -qa | grep yum
yum-rhn-plugin-0.5.3-30.el5
yum-3.2.19-18.el5
yum-security-1.1.16-13.el5
yum-updatesd-0.9-2.el5
yum-metadata-parser-1.1.2-2.el5
|
3.2卸载原有的yum
1
| [iyunv@localhost yum.repos.d]# rpm -qa | grep yum | xargs rpm -e --nodeps
|
3.3下载yum 的rpm包
但是你要搞清楚,你是i386的cpu还是x84_64。支持X86指令系统的,都属于X86家族, i386是指intel发布的通用处理器类型,前者是64位数码机器适用,后者是32位数码机器适用。前者机器可以兼用32位数码软件,后者机器只能用32位数码软件。这就是两者区别。
我的机器是64位的,所以下载的是 如下的软件包
但是安装的时候安不上,有依赖关系,如果你的电脑上提前就有这些包的话就可以使用64位的
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| [iyunv@localhost yum.repos.d]# rpm -ivh yum-*
warning: yum-3.2.22-40.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
libc.so.6()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
libc.so.6(GLIBC_2.2.5)(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
libglib-2.0.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
libm.so.6()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
libpthread.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
libsqlite3.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
libxml2.so.2()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
libz.so.1()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
[iyunv@localhost yum.repos.d]# rpm -ivh --nodeps yum-*
warning: yum-3.2.22-40.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
package yum-metadata-parser-1.1.2-4.el5.x86_64 is intended for a x86_64 architecture
[iyunv@localhost yum.repos.d]# which yum
/usr/bin/which: no yum in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
|
没有办法,只能下载通用的i386版本
3.4安装,可以忽略警告
1
2
3
4
5
6
| [iyunv@localhost yum.repos.d]# rpm -ivh yum-*
warning: yum-3.2.22-40.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:yum-metadata-parser ########################################### [ 33%]
2:yum-fastestmirror ########################################### [ 67%]
3:yum ########################################### [100%]
|
3.5验证,可以使用
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| [iyunv@localhost yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning up Everything
Cleaning up list of fastest mirrors
[iyunv@localhost yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Determining fastest mirrors
addons | 1.9 kB 00:00
addons/primary_db | 1.1 kB 00:00
base | 1.1 kB 00:00
base/primary | 996 kB 00:03
base 2791/2791
extras | 2.1 kB 00:00
extras/primary_db | 164 kB 00:00
update | 1.9 kB 00:00
update/primary_db | 729 kB 00:02
repo id repo name status
addons CentOS-5 - Addons 0
base CentOS-5 - Base 2,791
extras CentOS-5 - Extras 272
update CentOS-5 - Updates 653
repolist: 3,716
|
|
|