今天发现服务器上mail 发送邮件异常,想使用yum安装一下,发现这台系统是red hat 4 系统默认没有安装yum命令,于是就进行了安装及配置,操作方法如下:
安装:
cd /usr/local/src
wget
rpmbuild --rebuild yum-2.0.8-1.src.rpm
cd /usr/src/redhat/RPMS/noarch/
rpm -ivh yum-2.0.8-1.noarch.rpm
配置:
mv /etc/yum.conf /etc/yum.conf.bak
vi /etc/yum.conf
贴入以下内容:
[main]
cachedir=/var/cache/yumdebuglevel=2logfile=/var/log/yum.logpkgpolicy=newestdistroverpkg=redhat-releasetolerant=1exactarch=1[base] #name=Red Hat Linux $releasever - $basearch - Base #baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/$releasever/$basearch/ name=Red Hat Linux $releasever - $basearch - Base #baseurl= baseurl= #[updates] #name=Red Hat Linux $releasever - Updates #baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/updates/$releasever/ name=Red Hat Linux $releasever - Updates #baseurl= baseurl=#[base] #name=Red Hat Linux $releasever - $basearch - Base
#baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/$releasever/$basearch/ #name=Red Hat Linux $releasever - $basearch - Base #baseurl=
最后 yum list 等待更新完成就可以使用yum了;