REDHAT4.8安装yum
公司用的机器还在跑RHEL4(Red Hat Enterprise Linux AS 4.8),没有yum安装软件真是费时间啊,
于是上网找了半天yum安装方法,终于成功。分享一下:
核心:
wget http://yum.baseurl.org/download/2.0/yum-2.0.8-1.src.rpm
rpmbuild --rebuild yum-2.0.8-1.src.rpm
cd /usr/src/redhat/RPMS/noarch
rpm -ivh yum-2.0.8-1.noarch.rpm
配置 /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=CentOS-$releasever - Base
baseurl=http://vault.centos.org/4.9/os/x86_64/
gpgcheck=1
[updates]
name=Red Hat Linux $releasever - Updates
baseurl=http://vault.centos.org/4.9/updates/x86_64/
gpgcheck=1
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/4.9/os/x86_64/
gpgcheck=1
[updates]
name=Red Hat Linux $releasever - Updates
baseurl=http://vault.centos.org/4.9/updates/x86_64/
gpgcheck=1
4. 安装CentOS的GPG Key
# rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
5. 测试yum是否正常(下面是更新所有的rpm)
# yum update
*注意: 此方式更新所有已经安装的rpm,你不需要则可以取消
如果进行到第五步没有错误,那就基本正常了!