鉴行志

A blogging framework for hackers.

Redhat使用yum安装程序

| Comments

最近,要给一台redhat4服务器安装mapnik,在我自己工作的台机使用的是archlinux上,使用ABS安装环境那是相当方便,这台机器安装让人大伤脑筋。rpm包依赖要一个个找,而且,经常要自己编译源代码。

在centos系统中使用yum安装一点都不折腾,redhat4和centos算是同源,可以使用centos来做rh的更新。下面是安装yum的步骤。

安装 yum

方便在redhat 系统中安装软件包,现在的系统是redhat4企业版本,可以使用centos的软件包管理器

你可以用yum和rpm文件更新,其实很简单.

  1. 用wget下载yum

  2. # wget http://packages.sw.be/yum/yum-2.4.2-0.4.el4.rf.noarch.rpm

    1. 安装此rpm文件

    2. # rpm -ivh yum-2.4.2-0.4.el4.rf.noarch.rpm

    3. 配置 /etc/yum.conf 使用兼容的更新源(这里使用搜狐源,这个比较快。)

    4. [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://mirrors.sohu.com/centos/4/os/i386/

      gpgcheck=1

      [updates]

      name=Red Hat Linux $releasever – Updates

      baseurl=http://mirrors.sohu.com/centos/4/updates/i386/

      gpgcheck=1

      [dag]

      name=Dag RPM Repository for RHEL5

      baseurl=http://mirrors.sohu.com/dag/redhat/el5/en/$basearch/dag/

      enabled=1

      gpgcheck=1

      gpgkey=http://mirrors.sohu.com/dag/RPM-GPG-KEY.dag.txt

    5. 安装CentOS的GPG Key:

    6. # rpm --import http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-4

    7. 测试yum是否正常(下面是更新所有的rpm):

    8. # yum update //更新系统

    9. 建立缓存:

    10. #yum makecache

      下篇写mapnik的编译安装。

Comments