CentOS5 更新源 只要是centos就行,脚本是通用的

vi /etc/yum.repos.d/CentOS-Base.repo

 
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever – Base
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-5
#released updates
[update]
name=CentOS-$releasever – Updates
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever – Addons
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever – Plus
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
#contrib – packages by Centos Users
[contrib]
name=CentOS-$releasever – Contrib
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/contrib/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-5
enabled=0
#packages in testing
[testing]
name=CentOS-$releasever – Testing
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/testing/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-5
enabled=0

(可以省略了,以加入配置文件中)导入key

rpm –import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

运行,测试
yum update

或者用这个源
{}
____________________________________________________________

注:当第一次使用yum或yum资源库有更新时,yum会自动下载所有所需的headers放置于/var/cache/yum目录下,所需时间可能较长.
*rpm包的更新
//检查可更新的rpm包
#yum check-update
//更新所有的rpm包
#yum update
//更新指定的rpm包,如更新kernel和kernel source
#yum update kernel kernel-source
//大规模的版本升级,与yum update不同的是,连旧的淘汰的包也升级
#yum upgrade
*rpm包的安装和删除
//安装rpm包,如xmms-mp3
#yum install xmms-mp3
//删除rpm包,包括与该包有倚赖性的包
#yum remove licq
注:同时会提示删除licq-gnome,licq-qt,licq-text
*yum暂存(/var/cache/yum/)的相关参数
//清除暂存中rpm包文件
#yum clean packages
//清除暂存中rpm头文件
#yum clearn headers
//清除暂存中旧的rpm头文件
#yum clean oldheaders
//清除暂存中旧的rpm头文件和包文件
#yum clearn或#yum clearn all
注:相当于yum clean packages + yum clean oldheaders
*rpm包列表
//列出资源库中所有可以安装或更新的rpm包
#yum list
//列出资源库中特定的可以安装或更新以及已经安装的rpm包
#yum list mozilla
#yum list mozilla*
注:可以在rpm包名中使用匹配符,如列出所有以mozilla开头的rpm包
//列出资源库中所有可以更新的rpm包
#yum list updates
//列出已经安装的所有的rpm包
#yum list installed
//列出已经安装的但是不包含在资源库中的rpm包
#yum list extras
注:通过其它网站下载安装的rpm包
*rpm包信息显示(info参数同list)
//列出资源库中所有可以安装或更新的rpm包的信息
#yum info
//列出资源库中特定的可以安装或更新以及已经安装的rpm包的信息
#yum info mozilla
#yum info mozilla*
注:可以在rpm包名中使用匹配符,如列出所有以mozilla开头的rpm包的信息
//列出资源库中所有可以更新的rpm包的信息
#yum info updates
//列出已经安装的所有的rpm包的信息
#yum info installed
//列出已经安装的但是不包含在资源库中的rpm包的信息
#yum info extras
注:通过其它网站下载安装的rpm包的信息
*搜索rpm包
//搜索匹配特定字符的rpm包
#yum search mozilla
注:在rpm包名,包描述等中搜索
//搜索有包含特定文件名的rpm包
#yum provides realplay

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注