免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2059 | 回复: 1
打印 上一主题 下一主题

RHEL AS5.1软件安装小结 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-17 12:32 |只看该作者 |倒序浏览
近来本打算在机上安装apache httpd的rpm包,使用rpm -ivh 命令安装时发现与很多包有依赖关系,这样一个包一个包安装且不说嫌麻烦况且也不知道那个先那个后;后来转变思路rpm不行,俺用下载个tar.gz压缩包自己编译呗,运行./configure命令发现机上没有gcc,通过rpm -ivh gcc时又发现包的相互依赖,感觉不甚其烦。在网上google发现有yum这个好东西,我把使用yum的一些心得小结如下,以下配置实现软件的在线安装。
1.yum安装
  在RHEL AS5.1的安装光盘中自带有yum的rpm包,运行rpm -ivh yum.****.rpm 即可。或者安装前通过rpm -qi yum命令查看下。
2.yum配置
  安装后,其配置文件位于/etc/yum.conf,通过vi yum.conf打开配置文件并末尾处添加以下内容

  1. [Base]
  2. name=as5-base
  3. baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch
  4. gpgcheck=1
  5. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
复制代码

  由于RHEL AS系统升级为收费服务,所以无法使用RHEL自身的yum源进行软件安装和升级,但由于centos与RHEL系统几乎相差无几,所以对RHEL进行软件安装和升级时可使用centos的yum源。RHEL AS5.1yum的配置除更改yum.conf文件外还可在/etc/yum.repos.d下新建一个*.repo文件,把以上代码内容粘贴于此文件中而不用改动yum.conf文件,在以上代码中‘$basearch’表示电脑架构,PC的为I386。作此配置可实现软件的安装,如要实现系统升级需在配置[updates]项,完整repo配置文件内容如下。

  1. # CentOS-Base.repo
  2. #
  3. # This file uses a new mirrorlist system developed by Lance Davis for CentOS.
  4. # The mirror system uses the connecting IP address of the client and the
  5. # update status of each mirror to pick mirrors that are updated to and
  6. # geographically close to the client.  You should use this for CentOS updates
  7. # unless you are manually picking other mirrors.
  8. #
  9. # If the mirrorlist= does not work for you, as a fall back you can try the
  10. # remarked out baseurl= line instead.
  11. #
  12. #

  13. [base]
  14. name=CentOS-$releasever - Base
  15. baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch/
  16. gpgcheck=1
  17. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  18. #released updates
  19. [updates]
  20. name=CentOS-$releasever - Updates
  21. baseurl=http://centos.ustc.edu.cn/centos/5/updates/$basearch/
  22. gpgcheck=1
  23. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  24. #packages used/produced in the build but not released
  25. [addons]
  26. name=CentOS-$releasever - Addons
  27. baseurl=http://centos.ustc.edu.cn/centos/5/addons/$basearch/
  28. gpgcheck=1
  29. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  30. #additional packages that may be useful
  31. [extras]
  32. name=CentOS-$releasever - Extras
  33. baseurl=http://centos.ustc.edu.cn/centos/5/extras/$basearch/
  34. gpgcheck=1
  35. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  36. #additional packages that extend functionality of existing packages
  37. [centosplus]
  38. name=CentOS-$releasever - Plus
  39. baseurl=http://centos.ustc.edu.cn/centos/5/centosplus/$basearch/
  40. gpgcheck=1
  41. enabled=0
  42. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


复制代码

3.yum使用
   yum install 软件名,如yum install gcc

[ 本帖最后由 outmylife 于 2008-9-17 12:49 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-09-23 08:21 |只看该作者
如果我用的是rhel5.2的话,现在centos只到5.1,这样的话如何yum呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP