<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post//</link>
<title><![CDATA[CentOS 5的yum源更换为阿里云可用源]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[Linux技术]]></category>
<pubDate>Wed, 15 Mar 2017 04:32:27 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//</guid> 
<description>
<![CDATA[ 
	最近在老的机器（CentOS 5）上使用yum的时候发现不能正常使用，打开相关源的地址之后发现很多源都已经抛弃了CentOS 5了，大家常用的如：<br/>1、网易：http://mirrors.163.com/centos/<br/>2、搜狐：http://mirrors.sohu.com/centos/<br/>3、科技大学：http://mirrors.ustc.edu.cn/centos/<br/>无一例外，全都不可使用了，于是前往阿里云的镜像源看看，发现阿里云的源还保留着，阿里云Linux安装镜像源地址：http://mirrors.aliyun.com/，这样就简单了，只需将系统的更新源替换为阿里云的即可。<br/>CentOS系统更换软件安装源：<br/>1、备份<textarea name="code" class="c" rows="15" cols="100">mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup</textarea><br/>2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/<br/><textarea name="code" class="c" rows="15" cols="100">CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo</textarea><br/>3、之后运行yum makecache生成缓存<br/><textarea name="code" class="c" rows="15" cols="100">yum clean all
yum makecache</textarea><br/>如果你使用的是阿里云的服务器，将源的域名从mirrors.aliyun.com改为mirrors.aliyuncs.com,不占用公网流量。<br/><textarea name="code" class="c" rows="15" cols="100">#批量替换：
sed -i 's#mirrors.aliyun.com#mirrors.aliyuncs.com#' /etc/yum.repos.d/CentOS-Base.repo</textarea><br/>Tags - <a href="http://www.zhanghaijun.com/tags/linux/" rel="tag">linux</a> , <a href="http://www.zhanghaijun.com/tags/yum/" rel="tag">yum</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post//#blogcomment</link>
<title><![CDATA[[评论] CentOS 5的yum源更换为阿里云可用源]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>