Centos yum源更换为国内的阿里云镜像源的方法
<p><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">阿里云是最近新出的一个镜像源。得益于阿里云的高速发展,这么大的需求,肯定会推出自己的镜像源。 </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">阿里云Linux安装镜像源地址:</span>http://mirrors.aliyun.com/<br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><strong style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">CentOS系统更换软件安装源</strong><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"> </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><strong style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">第一步:备份你的原镜像文件,以免出错后可以恢复。(字母需要区分大小写)</strong><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><br/></p><pre class="brush:bash;toolbar:false">mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup</pre><p><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px; background-color: rgb(221, 237, 251);"></span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><strong style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">第二步:下载新的CentOS-Base.repo 到/etc/yum.repos.d/</strong><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"> </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">CentOS 5 </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"></span></p><pre class="brush:bash;toolbar:false">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo</pre><p><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">CentOS 6 </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"></span></p><pre class="brush:bash;toolbar:false">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo</pre><p><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">更改CentOS-Media.repo使其为不生效: </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">enabled=0 </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><strong style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">第三步:运行yum makecache生成缓存</strong><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"> </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">清空yum缓存 </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"></span></p><pre class="brush:bash;toolbar:false">yum clean all</pre><p><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">生存缓存 </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"></span></p><pre class="brush:bash;toolbar:false">yum makecache</pre><p><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;">开始更新系统以及内核 </span><br style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"/><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"></span></p><pre class="brush:bash;toolbar:false">yum upgrade</pre><p><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"></span><br/></p><p><span style="font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;"><br/></span></p>
頁:
[1]