[Linux] CentOS 7 yum repo 변경(EOS)

CentOS 7의 공식 EOS 날짜는 2024년 6월 30일로 종료되면서 기본 저장소가 비활성화되었기 때문에, yum 명령어 실행 시 저장소를 찾지 못해 오류가 발생합니다. CentOS 7 yum repo 변경을 한 후에 문제 해결이 가능합니다.
CentOS 7에서 EOS(End of Support)에 따라 CentOS 7을 처음 설치 시 설정 된 yum 명령어 실행 시
One of the configured repositories failed (Unknown),
and yum doesn’t have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work “fix” this:
과 같은 오류를 확인할 수 있습니다.
✅ CentOS 7 yum repo 변경 진행
yum 저장소에서 백업 폴더 생성 후 기존 *.repo 파일들을 백업 폴더로 이동 시킵니다.
~]# cd /etc/yum.repos.d/
yum.repos.d]# ll
합계 40
-rw-r--r--. 1 root root 1664 10월 23 2020 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 10월 23 2020 CentOS-CR.repo
-rw-r--r--. 1 root root 649 10월 23 2020 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 630 10월 23 2020 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 10월 23 2020 CentOS-Sources.repo
-rw-r--r--. 1 root root 8515 10월 23 2020 CentOS-Vault.repo
-rw-r--r--. 1 root root 314 10월 23 2020 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 616 10월 23 2020 CentOS-x86_64-kernel.repo
yum.repos.d]# mkdir Backup
yum.repos.d]# mv CentOS-* Backup/
yum.repos.d]# ll
합계 0
drwxr-xr-x. 2 root root 220 5월 18 15:20 Backup yum.repos.d]# vi CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7[base]부터 [centosplus]까지 섹션에서 mirrorlist를 주석 처리하고, baseurl을 vault.centos.org로 변경합니다.
CentOS Vault는 CentOS의 특정 버전의 지원이 종료된 경우 사용자들이 종료된 버전의 패키지를 사용할 수 있도록 과거 패키지들을 지원하는 저장소입니다. 현재와 같은 CentOS 7 yum repo 변경이 필요한 경우에 저장소 설정을 하는 용도로 사용할 수 잇습니다.
✅ yum 명령어 실행
CentOS 7 yum repo 변경 작업 완료 후 yum clean all 명령으로 yum cache를 초기화 한 후에
yum 명령어를 입력하면 정상적으로 작동되는 것을 확인할 수 있습니다.
yum update
yum.repos.d]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/4): base/x86_64/group_gz | 153 kB 00:00:01
(2/4): extras/x86_64/primary_db | 253 kB 00:00:01![[Linux] CentOS 7 yum repo 변경(EOS) 1 리눅스Linux(회색 배경의 나무 큐브)-CentOS 7 yum repo 변경에 대한 ..](https://uknew.co/storage/2023/12/%EB%A6%AC%EB%88%85%EC%8A%A4Linux%ED%9A%8C%EC%83%89-%EB%B0%B0%EA%B2%BD%EC%9D%98-%EB%82%98%EB%AC%B4-%ED%81%90%EB%B8%8C.jpg)
ℹ️ 제휴 안내
본 사이트의 콘텐츠에는 제휴 링크가 포함되어 있습니다. 방문자가 이 링크를 통해 상품 또는 서비스를 구매하면 본 사이트는 판매처로부터 수수료를 지급받습니다. 이 과정에서 구매자가 지불하는 금액(이벤트 할인 시 금액이 내려갑니다↓)은 오르지 않습니다. 게시된 가격·할인·재고 정보는 작성 시점 기준이며 실제와 다를 수 있으므로, 구매 전 판매처에서 최종 확인하시기 바랍니다. 상품 선정과 평가는 자체 기준에 따라 작성되며, 수수료 지급 여부가 소개 순서나 평가 내용에 영향을 주지 않습니다.