본문 바로가기
OS

[OS]CentOS 7 공식 지원 종료, Vault 저장소로 yum 임시 운용법

by Coarti 2024. 7. 2.

Centos 7 EOL(End of Life)

2024. 6. 30 CentOS 7 유지보수 지원(EOL)이 종료되어 yum 패키지 관리에 문제가 발생하지만,

CentOS Vault 저장소를 활용해 임시적으로 시스템을 계속 운용할 수 있다.

 

Centos 6 때에도 동일하게 발생했기에 레드햇 공식 홈페이지, 블로그를 참고해 임시 운영 방법을 마련했다.

문제 상황

yum 사용 시 "Could not resolve host: mirrorlist.centos.org"와 "HTTP Error 404 - Not Found" 등의 오류로 패키지 설치가 불가하다.

yum list | grep jdk

//결과

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"


 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:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64
yum install -y java-11-openjdk-devel.x86_64

// 결과
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
 * epel: ftp.kaist.ac.kr
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
http://mirror.kakao.com/centos/7.9.2009/updates/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.

 

방법

CentOS-Base.repo 파일에 있는 모든 baseurl을 Centos Vault의 URL로 변경해야한다.

# 기호로 주석을 처리 할 수 있다.

vi /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/

baseurl=http://vault.centos.org/7.9.2009/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/

baseurl=http://vault.centos.org/7.9.2009/os/$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/

baseurl=http://vault.centos.org/7.9.2009/os/$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/

baseurl=http://vault.centos.org/7.9.2009/os/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

 

참고

# centos 8
/usr/libexec/platform-python -c 'import dnf, json; db = dnf.dnf.Base(); print(json.dumps(db.conf.substitutions, indent=2))'

# centos 7
python -c 'import yum, json; yb = yum.YumBase(); print json.dumps(yb.conf.yumvar, indent=2)'
$releasever, $basearch를 확인할 수 있다

 

확인

파일의 내용을 변경후 아래의 명령어를 실행 하자.

yum clean all # 캐시 삭제
yum makecache # 캐시 재구성

 

 

패키지 매니저가 동작하는 것을 확인할 수 있다.

 


마무리

Centos 7 은 EOL을 맞이하여 더이상 보안이나 추가적인 업데이트를 지원하지 않는다.

따라서 RHEL(Red Hat Enterprise Linux) 또는 Rocky Linux 으로 마이그레이션(이관, 정보 이동) 해야한다.

 

더이상 Red Hat에서 RHEL을 CentOS로 하여 무료버전을 배포하지 않으므로

유료로 RHEL 또는 무료인 Rocky Linux가 대안이 될 수 있다. Rocky Linux는 RHEL 소스를 기반하여 호환되도록 설계되어있다.



 

CentOS Linux EOL 필수 정보: 지원 종료 및 마이그레이션 안내

CentOS Linux 7 지원이 종료(EOL)되었습니다. CentOS EOL의 필수 정보, 준비 방법, 안정적인 Red Hat의 마이그레이션 지원 방안에 대해 간단하고 쉽게 알아보세요.

www.redhat.com

 

 

CentOS EOS 시점과 대안은? RockyOS로 마이그레이션 방안과 갈아타는 이유?

안녕하세요. 시스템 엔지니어들은 작년부터 골머리 아픈 부분이 있죠.바로 CentOS EOS 입니다. 1. 도대체 CentOS EOS가 뭐길래 이렇게 호들갑들이여?CentOS Linux 7은 2024년 6월 30일에 지원 종료 (End of Serv

seculog.tistory.com

 

 

Index of /

 

vault.centos.org

 

728x90

'OS' 카테고리의 다른 글

CentOS 7 Install Error: Package  (0) 2024.08.13