Backup Ali source configuration file
[root@rhel64 yum.repos.d]# ls
CentOS-Base.repo packagekit-media.repo rhel-source.repo rhel-source.repo.bak
[root@rhel64 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak
Download Aliyuan configuration file (2 ways)
[root@rhel64 yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2523 100 2523 0 0 8661 0 --:--:-- --:--:-- --:--:-- 14335
another way to download
[root@localhost ~]#wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
Update the mirror source
[root@rhel64 yum.repos.d]# ls
CentOS-Base.repo packagekit-media.repo rhel-source.repo rhel-source.repo.bak
[root@rhel64 yum.repos.d]# yum clean all
Failed to set locale, defaulting to C
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: InstallMedia base extras rhel64 updates
Cleaning up Everything
[root@rhel64 yum.repos.d]# yum makecache
Failed to set locale, defaulting to C
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
base | 3.6 kB 00:00
base/group_gz | 153 kB 00:00
base/filelists_db | 7.2 MB 00:10
base/primary_db | 6.1 MB 00:08
base/other_db | 2.6 MB 00:03
extras | 2.9 kB 00:00
extras/filelists_db | 276 kB 00:00
extras/primary_db | 249 kB 00:00
extras/other_db | 149 kB 00:00
updates | 2.9 kB 00:00
updates/filelists_db | 12 MB 00:17
updates/primary_db | 22 MB 00:34
updates/other_db | 1.4 MB 00:02
Metadata Cache Created
1 If the following error occurs: http://mirrors.aliyun.com/centos/7Server/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 – Not Found
2 Reason for error: The releasever variable in the Centos-base.repo configuration file is parsed incorrectly, resulting in an error in the entire url address. This kind of situation usually occurs when the centos source is installed in the redhat system. http://mirrors.aliyun.com/centos/ found that there is no 7 server / directory. Therefore, it should be a releasever variable parsing error, resulting in an error in the entire url address. This kind of situation usually occurs when the redhat system installs the centos source, http://mirrors.aliyun.com/centos/, it is found that there is no 7server/ directory. Therefore, it should bere l e a server variable parsing error, resulting in the entire url address error . This kind of situation usually happens when red ha t system installs ce n t os source , h ttp://mirrors.aliyun.com/centos/,Found that there is no 7 server / directory . Therefore, it should be that the releasever variable is parsed into 7server, which leads to errors.
3
solutions:
#1. Modify the yum configuration file
[wanchao@localhost ~]$ vim /etc/yum.repos.d/CentOS-Base.repo
#2. Put all the " KaTeX parse error: Expected 'EOF', got '#' at position 38: ... in the full text into the command line mode for my system centos7 version #̲: %s/ releaseever/ 7/g
#Save And exit
: wq
update the mirror source again
[wanchao@localhost ~]$ yum clean all
[wanchao@localhost ~]$ yum makecache
Link: https://www.jianshu.com/p/4d6943110841