在redhat 4中,yum需要單獨地安裝:
(1)先查看當前redhat系統的版本:cat /etc/issue
顯示:Red Hat Enterprise Linux AS release 4 (Nahant Update 7)
Kernel \r on an \m
系統資訊存放在issue檔案中。
(2)下載yum軟體包:http://yum.baseurl.org/download/2.0/yum-2.0.8-1.src.rpm
(3)安裝
$sudo rpmbuild --rebuild yum-2.0.8-1.src.rpm
(4)安裝成功後,進入到:/usr/src/redhat/RPMS/noarch/,並安裝yum的rpm包:
$cd /usr/src/redhat/RPMS/noarch/
$sudo rpm -ivh yum-2.0.8-1.noarch.rpm
(5)yum的設定檔(如果沒有的話,可以自己建立)
$sudo vim /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://apt.sw.be/redhat/el4/en/i386/dag/
或者
(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/
現在問題的關鍵是,AS4的yum源現在都不維護了,好多源地址都不可用,少數可用的,rpm包還不全。現在是AS5和AS6最常用了。
(6)測試yum命令:
$yum -y install lzo-devel zlib-devel