centos源(官方test源和科大源)

来源:互联网 发布:linux命令大全chmod 编辑:程序博客网 时间:2024/06/05 23:52

CentOS为yum添加官方源
由于centos5.4安装好后通过yum来安装php的版本是5.1.6,现在很多站点都是在5.2.x上开发的,所以我们要添加其他的yum repo
来安装Php5.2.x的版本,测试了几个非官方的repo仓库,感觉代码都不是很稳定,php版本也随时在升级。找了很久,发现centos
官方的一个test repo里面有php5.2.x,安装centos官方的rpm比较放心

1.添加yum repo php5.2.x

vi /etc/yum.repos.d/CentOS-Testing.repo
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
priority=1

2.安装

yum upgrade php

科大源
首先备份/etc/yum.repos.d/CentOS-Base.repo

然后下载对应版本 的repo文件,放入/etc/yum.repos.d/:

wget http://mirrors.ustc.edu.cn/centos/CentOS-Base.5.mirrors.repo -O /etc/yum.repos.d/CentOS-Base.repo

 mv /etc/yum.repos.d/CentOS-Base.repo{,.save}