yum:The requested URL returned error: 404

在使用yum的时候总是提示The requested URL returned error: 404这个错误:

//使用的是163的源	http://mirrors.163.com/.help/CentOS6-Base-163.repo

[base]

name=CentOS-$releasever - Base - 163.com

baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 

配置好以后,直接yum clean all,没什么问题,接下来yum makecache 出现了问题:

http://mirror.centos.org/centos/%24releasever/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

查看系统变量能否解释:

# echo $releasever

如果不能, 则需要更换yum源:

[base]

name=CentOS-$releasever - Base - 163.com

#baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/

baseurl=http://mirrors.163.com/centos/6/os/i386/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

完成后:

#yum clean all //清除yum缓存
#yum makecache //加载yum源包信息
#yum upgrade	// 升级软件包(yum update 同时升级系统内核)

你可能感兴趣的:(Linux,Linux的圈子不好混,yum:The,requested,URL,returned,erro)