好的,我想通了.我创建了一个文件CentOs.repo(/etc/yum.repos.d/CentOs.repo),其中包含以下内容:
原文链接:https://www.f2er.com/centos/373755.html[CentOS-Base] name=CentOS-Base mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os gpgcheck=1 enabled=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 [CentOS-Updates] name=CentOS-Updates mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates gpgcheck=1 enabled=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 [CentOS-Plus] name=CentOS-Plus mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus gpgcheck=1 enabled=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5