CentOS 8에서 dnf install로 패키지를 설치하고자 할 때 본 에러가 나타날 경우가 존재합니다.
이때 사용할 수 있는 방법을 아래 사이트에서 확인할 수 있었습니다.
https://techglimpse.com/solve-failed-synchronize-cache-repo-appstream/
How to fix "Failed to synchronize cache for repo appstream" - Techglimpse
This article will help you to resolve the issue synchronize cache for repo 'appstream' when encountered during upgrading CentOS 7 to CentOS 8...
techglimpse.com
순서는 다음과 같습니다.
[root@upgrade-centos ~]# dnf clean all
[root@upgrade-centos ~]# rm -rf /var/cache/dnf
CentOS Linux 8의 경우 2021년 12월 31일을 기점으로 더이상 공식 개발 리소스를 받을 수 없습니다. 이에따라 mirror를 vault.centos.org로 변경할 필요가 있습니다.
[root@autocontroller ~]# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
[root@autocontroller ~]# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
[root@autocontroller ~]# dnf update
만약 이후에 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist가 뜬다면 아래 링크를 참조하세요.
https://aigong.tistory.com/598
[CentOS] CentOS 8 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirror
[CentOS] CentOS 8 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist 해결법 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlis
aigong.tistory.com