Failed to download metadata for repo 'BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Errors during downloading metadata for repository 'BaseOS':
- Status code: 404 for http://mirrors.jdcloudcs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 100.66.2.1)
Error: Failed to download metadata for repo 'BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
-bash: docker: command not found
Failed to restart docker.service: Unit docker.service not found.
Failed to enable unit: Unit file docker.service does not exist.
网上一搜, 很多处理方案,基本都一样。 但是我怎么弄都不行,问题在哪里。
处理步骤:
1. 创建一个bak 目录;
[root@localhost data]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mkdir bak
[root@localhost yum.repos.d]# ls
bak
2. 下载新的源文件,并用命令yum makecache建立新的元数据缓存
[root@1672668773527 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
--2023-01-02 23:57:08-- https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 180.101.198.241, 58.216.14.239, 58.216.14.240, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|180.101.198.241|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2495 (2.4K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’
/etc/yum.repos.d/CentOS-B 100%[==================================>] 2.44K --.-KB/s in 0s
2023-01-02 23:57:08 (48.1 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2495/2495]
[root@1672668773527 yum.repos.d]# ls
bak CentOS-Base.repo
[root@1672668773527 yum.repos.d]# yum makecache
CentOS-8.5.2111 - Base - mirrors.aliyun.com 468 kB/s | 4.6 MB 00:10
CentOS-8.5.2111 - Extras - mirrors.aliyun.com 76 kB/s | 10 kB 00:00
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com 470 kB/s | 8.4 MB 00:18
Metadata cache created.
3.测试源(用yum命令装个软件试试)
[root@1672668773527 yum.repos.d]# yum install -y yum-utils
Last metadata expiration check: 0:00:52 ago on Mon 02 Jan 2023 11:58:50 PM CST.
Dependencies resolved.
==================================&#