redhat安装yum

Linux localhost.localdomain 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35
查看是否安装了yum命令:rpm -qa|grep yum
EDT 2007 i686 i686 i386 GNU/Linux
[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 5)
一、
1.下载软件包:
http://yum.baseurl.org/download/2.0/yum-2.0.8-1.src.rpm
2.安装(由于是RPM源码包所以安装比较特殊)
#rpmbuild --rebuild /home/sean/yum-2.0.8-1.src.rpm     //注意这里rpm要写它所在的绝对路径。
+++++++++++++++++++安装过程+++++++++++++++++++
Requires(post): /bin/sh
Requires(preun): /bin/sh
Requires: /bin/bash /bin/sh /usr/bin/python config(yum) = 2.0.8-1
libxml2-python python rpm >= 0:4.1.1 rpm-python
Obsoletes: yum-phoebe
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/yum-
2.0.8root
Wrote: /usr/src/redhat/RPMS/noarch/yum-2.0.8-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.40887
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd yum-2.0.8
+ ‘[' /var/tmp/yum-2.0.8root '!=' / ']‘
+ rm -rf /var/tmp/yum-2.0.8root
+ exit 0
Executing(–clean): /bin/sh -e /var/tmp/rpm-tmp.40887
+ umask 022
+ cd /usr/src/redhat/BUILD
+ rm -rf yum-2.0.8
+ exit 0
+++++++++++++++++++安装过程+++++++++++++++++++
[root@localhost ~]#
3.进入到:/usr/src/redhat/RPMS/noarch/               //我的是centos,所以这一条根本不成立,但又不知道正确的写法怎么写,所以就没执行此步,结果还是不可用,但已经安装了!
root@localhost RPMS]# cd /usr/src/redhat/RPMS/noarch/
[root@localhost noarch]# rpm -ivh yum-2.0.8-1.noarch.rpm
Preparing…                ###########################################
[100%]
  1:yum                    ###########################################
[100%]
二、配置文件部份:
[root@localhost ~]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
[base]
name=Red Hat Linux $releasever - $basearch - Base
baseurl= http://centos.ustc.edu.cn/centos/4/os/i386/
[updates]
name=Red Hat Linux $releasever - Updates
baseurl= http://mirror.centos.org/centos/4/updates/i386/      //我的没有后两部分!只有第一部分【main】

或者(64 bit)

[main]

cachedir=/var/cache/yum

debuglevel=2

logfile=/var/log/yum.log

pkgpolicy=newest

distroverpkg=redhat-release

tolerant=1

exactarch=1

[base]

name=Red Hat Linux $releasever - $basearch - Base

baseurl=http://centos.ustc.edu.cn/centos/4/os/x86_64/

[updates]

name=Red Hat Linux $releasever - $basearch - Base

baseurl=http://centos.ustc.edu.cn/centos/4/os/x86_64/

三、完成了,测试下吧。
[root@localhost noarch]# yum update
Gathering header information file(s) from server(s)
Server: Red Hat Linux 4AS - i386 - Base
Server: Red Hat Linux 4AS - Updates
Finding updated packages
Downloading needed headers
xorg-x11-xauth-0-6.8.2-1. 100% |=========================|  84 kB    
00:01    
perl-HTML-Parser-0-3.55-1 100% |=========================| 3.5 kB    
00:00    
tar-0-1.14-12.5.1.RHEL4.i 100% |=========================| 5.1 kB    
00:00    
perl-XML-LibXML-Common-0- 100% |=========================| 1.9 kB    
00:00    
retrygrab() failed for:
  http://mirror.centos.org/centos/4/updates/i386//headers/openssh-
server-0-3.9p1-11.el4_7.i386.hdr
  Executing failover method
failover: out of servers to try
Error getting file
http://mirror.centos.org/centos/4/updates/i386//headers/openssh-server-
0-3.9p1-11.el4_7.i386.hdr
[Errno 4] IOError: <urlopen error >
只是为了测试,我取消了更新.
[root@localhost noarch]# yum –version

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值