文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>关于RedHat 5U3 的yum源配置

关于RedHat 5U3 的yum源配置

时间:2010-07-23  来源:shanhuhai_567

今天我为了在redhat下安装一个firefox的flash插件,引出了我对yum源的配置。用过ubuntu的spt-get,那个还是相当好用的,不过是你在选对源的基础之上的,什么是源呢,一开始我刚接触源这个名词的时候,很是不理解。不管他是什么东西,能给你解决问题是最重要的不是?!你实际操作之后,源不过如此,就是像水源的东西,不过你在源里取到的是你系统里需要的软件,我的理解可能有一些肤浅,希望朋友们指点。

    yum的配置,比起ubuntu里的apt-get配置起来可能要麻烦点,不过也只是格式上的不同而已。先就我自身的经历来说一下吧。以前我都是用的光盘安装的,就是yum中所用到的本地源的配置。

1,yum本地源的配置与使用

  a:挂载你的光盘到一个目录下:mount -t iso9660 /dev/cdrom /mnt/cdrom

  b:修改你的yum配置文件:编辑 /etc/yum.repos.d/rhel-debuginfo.repo 文件,里面有给

  [rhel-debuginfo]

  name=Red Hat Enterprise Linux $releasever - $basearch - Debug

  baseurl=file:///mnt/cdrom/Server

  enabled=1

  gpgcheck=0

  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

  主要是baseurl,enabled,gpgcheck字段的配置,本地就是要使用file://absolute path.

   保存并退出。

  c:yum update

 这里有想必大家有个疑问,光盘放进光驱后,如果能识别的话就已经自动挂载到了/media 下为什么我们还要费事手动挂载呢?这个倒是必须的,因为你不挂载的话你yum需要的repodata文件是没有任何东西的,因为yum要去读这个文件才会自动给你解决依赖关系的。

  还有一个想要与大家一起学习的就是,在你没有盘,只有iso文件时怎么办?很简单,一条命令解决 mount -o loop /xx/xx/xxx.iso /mnt/cdrom你可以继续了。呵呵~

2、网络源的配置

 这些是我吸取前辈的精华,同样是修改上面所提到的配置文件里的内容:

[base]

name=CentOS-5 - Base

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&

repo=os

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#released updates

[update]

name=CentOS-5 - Updates

#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates

baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#packages used/produced in the build but not released

[addons]

name=CentOS-5 - Addons

#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons

baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that may be useful

[extras]

name=CentOS-5 - Extras

#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras

baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-5 - Plus

#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus

baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#contrib - packages by Centos Users

[contrib]

name=CentOS-5 - Contrib

#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib

baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

# vi dag.repo

[dag]

name=Dag RPM Repository for RHEL5

baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/

enabled=1

gpgcheck=1

gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt

 

再者导入key  rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

 

最后:yumupdate

欢迎大家的探讨与指点

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载