리눅스

CentOS 7의 EOL 문제로 인해 발생하는 패키지 설치 오류를 해결하는 방법

변군이글루 2024. 10. 5. 16:15
반응형

CentOS 7의 EOL 문제로 인해 발생하는 패키지 설치 오류를 해결하는 방법

CentOS 7의 기본 저장소가 EOL(End of Life) 상태가 되면서 더 이상 업데이트나 패키지 설치가 제대로 되지 않을 수 있습니다. 이를 해결하기 위해 카카오, 네이버 미러 저장소 또는 CentOS Vault 저장소를 사용할 수 있으며 EPEL(Extra Packages for Enterprise Linux) 저장소를 추가하면 추가 패키지를 설치할 수 있습니다.

1. 기존 저장소 파일 백업

기존 저장소 설정을 백업해 두는 것이 좋습니다.

sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
더보기

---

cat /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

---

2. 카카오 미러 저장소 설정

카카오 미러 저장소 : mirror.kakao.com

sudo sed -i.bak \
-e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org|baseurl=http://mirror.kakao.com|g' \
/etc/yum.repos.d/CentOS-Base.repo
728x90

3. 네이버 미러 저장소 설정

네이버 미러 저장소 : mirror.navercorp.com

sudo sed -i.bak \
-e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org|baseurl=http://mirror.navercorp.com|g' \
/etc/yum.repos.d/CentOS-Base.repo

4. CentOS Vault 저장소 설정

Vault 미러 저장소 : vault.centos.org

 

sudo sed -i.bak \
-e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org/7.9.2009|g' \
/etc/yum.repos.d/CentOS-Base.repo

5. EPEL 저장소 추가

sudo yum install -y epel-release

6. yum 캐시 정리 및 업데이트

sudo yum clean all
sudo yum makecache

 

CentOS 7의 EOL 문제로 인해 발생하는 패키지 설치 오류를 해결할 수 있습니다.

 

728x90
반응형