CentOS 6 가 20년 11월 30일자로 제품 수명이 종료(EOL; End of Life) 되었습니다. 

그래서 더 이상 yum 명령어를 실행하면 아래와 같이 "YumRepo Error: All mirror URLs are not using ftp, http[s] or file." 에러가 나고  제대로 동작하지 않습니다.

$ yum search gcc

Loaded plugins: changelog, fastestmirror, presto, refresh-packagekit, verify
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base
BASH


좋은 방법은 CentOS 7 이나 CentOS 8 으로 전환하는 것이지만 재설치가 필요하므로 서비스중인 장비라면 쉬운 방법이 아니며 아래의 방법으로 yum 명령어 동작하도록 임시 조치할 수 있습니다.

임시 조치일 뿐이며 EOL 된 제품의 버그나 보안 패치는 더이상 나오지 않으므로 해당 시스템이 취약해질 우려가 있습니다.


Vault 사용

CentOS 는 예전 버전에 대한 스냅샷 용도로 vault.centos.org 를 운영하고 있으므로 저장소를 이곳으로 변경해서 사용하면 됩니다.

centos vault 는 예고없이 서비스가 중지될 수 있으니 임시 조치로만 사용하세요.


먼저 가장 빠른 미러를 찾아주는 fast mirror 플러그인을 중지합니다. 에디터로 /etc/yum/pluginconf.d/fastestmirror.conf 를 열어서 enabled=0 으로 설정합니다.

[main]
enabled=0
verbose=0
always_print_best_host = true
socket_timeout=3
CODE


이제 vault 용 저장소를 생성하기 위해 /etc/yum.repos.d/vault.repo 파일을 생성하고 다음 내용을 추가합니다.

[vault]
name=CentOS-$releasever - Vault
baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=1
CODE


확인을 위해 yum 명령어를 실행해서 repository 목록에 표시되는지 확인합니다.

$ yum repolist

repo id                      repo name                                                                       status
remi-safe                    Safe Remi's RPM repository for Enterprise Linux 6 - x86_64                      2,973
vault                        CentOS-6 - Vault                                                                6,713

repolist: 9,686
CODE

Local 저장소 사용

인터넷이 단절된 환경이라면 CentOS, RHEL에 ISO 파일로 로컬 yum 저장소(Local yum repository) 만들기 를 참고해서 ISO 이미지로 서버에 저장소를 만들고 사용할 수 있습니다.

같이 보기