首页 » Linux »

更新centos yum源为163源的步骤

centos使用yum安装lighttpd的时候出现以下报错,不用说,yum源用的官方的,在我大天朝当然走不通了,更新成163的源试试

yum install lighttpd
Loaded plugins: fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 7 - ""
Error: Cannot find a valid baseurl for repo: base

更新centos yum源的步骤

[1] 首先备份/etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

[2] 进入yum源配置文件所在文件夹

cd /etc/yum.repos.d/

[3] 下载163的yum源配置文件,放入/etc/yum.repos.d/(操作前请做好相应备份)

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

[4] 运行yum makecache生成缓存

yum makecache

[5] 更新系统

yum -y update

本文标签:

相关文章推荐

转载请保留,转载自:老牛博客
原文地址 http://xiaohost.com/1744.html

发表评论