您的位置:首页 > Web前端

RHEL6使用Fedora13的YUM源

2011-05-04 12:20 369 查看
最近在搞CactiEZ,基于RHEL6发行版制作的,总要用到yum把基本的开发库装上吧,要不怎么编译软件,官方源是要收钱的,本地源拉个镜像上服务器有点不太实际,只好找在线源,上网看到一篇文章将fedora13的源用在RHEL6,实验了一下

RHEL6的软件包是基于fedora13的,但比fedora13稍微新一点

rpm -qa | grep yum 发现还是默认安装了yum包,几次 rpm -e 弄清楚依赖关系后,最终

1.卸掉了yum(请依据你自己情况灵活处理)

我这里用到的方法是

rpm -qa|grep yum|xargs rpm -e --nodeps

#--nodeps这一选项取消了 rpm 的内部相关性检查,不用这项删不掉

使用源 http://mirrors.sohu.com/fedora/releases/13/Fedora/x86_64/os/

下載5個包

yum-3.2.27-4.fc13.noarch.rpm

yum-metadata-parser-1.1.4-1.fc13.x86_64.rpm

yum-presto-0.6.2-1.fc13.noarch.rpm

yum-utils-1.1.26-1.fc13.noarch.rpm

deltarpm-3.5-0.7.20100121git.fc13.x86_64.rpm



rpm -ivh yum-*.rpm deltarpm-3.5-0.7.20100121git.fc13.x86_64.rpm

然后一个Key文件:wget http://mirrors.sohu.com/fedora/releases/13/Fedora/x86_64/os/RPM-GPG-KEY-fedora-x86_64

cp RPM-GPG-KEY-fedora-x86_64 /etc/pki/rpm-gpg/

之后修改/etc/yum.conf,保存安装包于/var/cache/yum/x86_64/13/下:

cachedir=/var/cache/yum/$basearch/13

keepcache=1

然后在/etc/yum.repos.d/下建三个文件

fedora.repo,fedora-updates.repo,fedora-updates-testing.repo

安装rpmfusion源fedora13的repo(直接安装不用yum,否则直接给你升级到fedora14会引起RHEL6稳定性受影响):

rpm -ivh http://mirrors.sohu.com/fedora/releases/13/Everything/x86_64/os/Packages/yum-plugin-fastestmirror-1.1.26-1.fc13.noarch.rpm

我用这个没用,是自己写/etc/yum.repos.d/fedora.repo

然后

rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm

rpm -ivh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

fedora.repo是自己写的,yum-plugin-fastestmirror自己找源好像用了没效果

/etc/yum.repos.d/fedora.repo

[Fedora-mirrors.sohu.com]

name=Fedora 13

baseurl=http://mirrors.sohu.com/fedora/releases/13/Fedora/x86_64/os/

enabled=1

gpgcheck=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64

开始yum安装(加上 --releasever=13 欺骗系统及yum让他们合作顺利安装fedora13的包):--releasever=这个好像不用也可以,不一定吧

1. gcc:

先卸载机上自带的glibc和glibc-common,否则装会提示你装了其他版本的glibc

rpm -e --nodeps --justdb glibc

rpm -e --nodeps --justdb glibc-common

装之前做好用yum list *gcc*查看下 ,装x86_64的,不要装i686的(好像x86_64性能更好,具体百度)

yum install gcc.x86_64

后来发现可以在yum.conf中过滤

vi /etc/yum.conf

[main]

...

exclude=*.i?86

例如

[root@VM-redhat yum.repos.d]# yum list *libxml2*

已加载插件:fastestmirror, presto

Loading mirror speeds from cached hostfile

已安装的软件包

libxml2.x86_64 2.7.6-1.el6 @anaconda-InstallationRepo-201101202142.x86_64/V10

libxml2-python.x86_64 2.7.6-1.el6 @anaconda-InstallationRepo-201101202142.x86_64/V10

可安装的软件包

compat-python24-libxml2.x86_64 2.7.7-1.fc13 rpmfusion-free

libxml2.x86_64 2.7.7-1.fc13 Fedora-mirrors.sohu.com

libxml2-devel.x86_64 2.7.7-1.fc13 Fedora-mirrors.sohu.com

libxml2-python.x86_64 2.7.7-1.fc13 Fedora-mirrors.sohu.com

像libxml2.x86_64 2.7.6-1.el6 装了如无必要就不用装libxml2.x86_64 2.7.7-1.fc13 了,而且装fc13可能不一定好,原生最稳定
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息