在redhat 4中,yum需要单独地安装:
(1)先查看当前redhat系统的版本:cat/etc/issue
显示:RedHatEnterpriseLinuxASrelease4(NahantUpdate7)
Kernel\ronan\m
系统信息存放在issue文件中。
(2)下载yum软件包:http://yum.baseurl.org/download/2.0/yum-2.0.8-1.src.rpm
(3)安装
$sudorpmbuild--rebuildyum-2.0.8-1.src.rpm
(4)安装成功后,进入到:/usr/src/redhat/RPMS/noarch/,并安装yum的rpm包:
$cd/usr/src/redhat/RPMS/noarch/
$sudorpm-ivhyum-2.0.8-1.noarch.rpm
(5)yum的配置文件(如果没有的话,可以自己创建)
$sudovim /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=RedHatLinux$releasever-$basearch-Base
baseurl=http://apt.sw.be/redhat/el4/en/i386/dag/
或者
(64bit)
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
[base]
name=RedHatLinux$releasever-$basearch-Base
baseurl=http://centos.ustc.edu.cn/centos/4/os/x86_64/
[updates]
name=RedHatLinux$releasever-$basearch-Base
baseurl=http://centos.ustc.edu.cn/centos/4/os/x86_64/
现在问题的关键是,AS4的yum源现在都不维护了,好多源地址都不可用,少数可用的,rpm包还不全。现在是AS5和AS6最常用了。
(6)测试yum命令:
$yum -y install lzo-devel zlib-devel