Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centos8 Error: Failed to download metadata for repo ‘AppStream‘ 解决方式 #3

Open
MarbloroX opened this issue May 15, 2022 · 0 comments

Comments

@MarbloroX
Copy link

MarbloroX commented May 15, 2022

切换目录

  • cd /etc/yum.repos.d/

然后在此目录下:

很关键的一步

  • rm CentOS-Linux-*

具体细节:
**1. cd /etc/yum.repos.d/

2. [yum.repos.d]# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

3. [yum.repos.d]# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

4. [yum.repos.d]# yum update -y**

Complete!

5. [yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 47.246.24.228, 47.246.24.230, 47.246.24.226, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|47.246.24.228|: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/Cent 100%[=========================>] 2.44K --.-KB/s in 0.002s
2022-05-13 16:06:36 (1.57 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2495/2495]

6 . [yum.repos.d]#yum clean all

Repository extras is listed more than once in the configuration
33 files removed

7.[yum.repos.d]#yum makecache

Repository extras is listed more than once in the configuration
CentOS-8.5.2111 - Base - mirrors.aliyun.com 1.4 MB/s | 4.6 MB 00:03
CentOS-8.5.2111 - Extras - mirrors.aliyun.com 9.8 kB/s | 10 kB 00:01
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com 1.1 MB/s | 8.4 MB 00:07
CentOS Linux 8 - AppStream 269 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

8. [yum.repos.d]# rm CentOS-Linux-*

删除目录下CentOS-Linux- 开头的文件
全部 Y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant