[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 변경에 대한 ..

Similar Posts

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다