CentOS系统默认的yum源有时候不能顺利安装软件,这个时候可以更新下默认的yum源,默认的yum 源配置文件:
/etc/yum.repos.d/CentOS-Base.repo, 可以直接替换这个文件,国内有的 163 及sohu 的源可以用
163的文件地址:
http://mirrors.163.com/.help/CentOS6-Base-163.repo
直接下载重命名替换即可。
命令:
1. cd /etc/yum.repos.d
2. mv CentOS-Base.repo CentOS-Base.repo.backup
3. wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
4. mv CentOS6-Base-163.repo CentOS-Base.repo
5.yum clean all
如果 你是自己的yum源,可以通过修改 此配置文件 CentOS-Base.repo 中 BaseUrl 信息为你的包路径从而完成yum 源的修改。
[base]
name=CentOS-$releasever - Base
#baseurl=http://10.3.101.65/centos/$releasever/os/$basearch/
baseurl=http://10.255.33.37/centos/6/Packages/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
[updates]
name=CentOS-$releasever - Updates
#baseurl=http://10.3.101.65/centos/$releasever/updates/$basearch/
baseurl=http://10.255.33.37/centos/6/Packages/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
[extras]
name=CentOS-$releasever - Extras
#baseurl=http://10.3.101.65/centos/$releasever/extras/$basearch/
baseurl=http://10.255.33.37/centos/6/Packages/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
#[epel]
#name=epel
#baseurl=http://10.3.101.65/epel/$releasever/$basearch/
#baseurl=http://10.3.101.65/epel/$releasever/$basearch/
#gpgcheck=0
#enabled=1
#[rpmforge]
#name=rpmforge
#baseurl=http://10.3.101.65/epel/$releasever/$basearch/
#baseurl=http://10.3.101.65/epel/$releasever/$basearch/
#gpgcheck=0
#enabled=1