Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

Dev Log

[Centos] Centos OS 설치 후 yum 실행 시 Cannot retrieve repository metadata (repomd.xml) 에러 해결방법 본문

Debug/Centos

[Centos] Centos OS 설치 후 yum 실행 시 Cannot retrieve repository metadata (repomd.xml) 에러 해결방법

JaewooAhn 2021. 5. 13. 11:08

yum Error: Cannot retrieve repository metadata 에러 해결방법

Centos OS를 설치한 후 yum 명령어 실행 시 발생하는 이슈입니다.

 

 

Centos 6은 2020년 11월 30일 부로 수명이 종료되었습니다.

http://mirror.centos.org/centos/6/readme 파일을 열어보면 다음과 같은 내용이 쓰여있습니다.

This directory (and version of CentOS) is deprecated. Please see this FAQ
concerning the CentOS release scheme:

https://wiki.centos.org/FAQ/General

Please keep in mind that 6.0, 6.1, 6.2, 6.3, 6.4 , 6.5, 6.6, 6.7, 6.8 , 6.9 and 6.10 no longer get any updates, nor
any security fix's.

The whole CentOS 6 is *dead* and *shouldn't* be used anywhere at *all*

 

해결 방법

Centos OS 6의 미러가 Deprecated되어 발생하는 에러로, 다음의 과정을 통해 해결 가능합니다.

 

  1. 인터넷 연결 확인
  2. CentOS-Base.repo 파일 수정

인터넷 연결 확인

우선 ping 명령어로 Centos mirror와 연결이 가능한지 확인합니다.

ping mirror.centos.org

연결이 가능하다면, 다음과 같은 실행 결과가 출력됩니다.

만약 아무런 실행 결과도 출력되지 않는다면, 연결이 가능하도록 인터넷을 설정해야 합니다.

그 부분에 대해선 추후에 따로 포스팅 하도록 하겠습니다.

 

 

CentOS-Base.repo 파일 수정

우선 /etc/yum.repos.d에 위치한 CentOS-Base.repo 파일을 열어줍니다.

만약 열리지 않거나 수정이 되지 않는다면, 관리자 권한으로 열어야 합니다.

nano /etc/yum.repos.d/CentOS-Base.repo

명령어를 실행하시면 다음과 같은 창을 볼 수 있습니다.

 

자세히 보시면 baseurl 속성이 전부 주석 처리 되어있는 걸 볼 수 있습니다.

mirrorlist 속성을 주석 처리 하고, baseurl 속성을 주석 해제합니다.

baseurl 속성의 mirror 부분을 vault로 바꿔줍니다.

 

저장 후 명령어가 정상적으로 실행되는 것을 확인할 수 있습니다.

yum update

 

결론

  1. 2020년 11월 30일 부로 Centos 6의 수명이 종료되었다.
  2. mirror.centos.org의 기존 파일들이 vault.centos.org로 옮겨져서 yum이 패키지를 찾지 못했다.
  3. /etc/yum.repos.d/CentOS-Base.repo의 baseurl을 mirror에서 vault로 바꿔주면 해결된다.