반응형

안녕하세요 유똥입니다

오늘은 CentOS 5,6 버전 yum 설치가 안 될 시 해결 방안에 대해서 포스팅 진행하겠습니다.

 

CentOS 6버전의 경우 2020년 11월 30일 부로 유지관리 업데이트 지원기간 종료로 인해

더이상 repo 즉 yum 설치가 막혀있습니다.

 

해당 버전을 계속 사용하는 경우 보안상 매우 취약하지만 기술적인 능력이 부족하여 서버 이전을 진행하지 못하거나,

서비스 다운을 고려하여 아직 해당 버전을 계속 사용을 해야하는 경우 아래의 해결 방법을 통해 문제 해결해보시기를 바랍니다.

 

 에러

Could not retrieve mirrorlist mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 알 수 없는 오류"
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/i386/6/base/mirrorlist.txt

Error: Cannot find a valid baseurl for repo: base
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

 

 해결방법

- CentOS6 기준

# CentOS06 일때 REPO 추가
sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
yum repolist

 

- CentOS5 기준

cd /etc/yum.repos.d/
cp CentOS-Base.repo CentOS-Base.repo.old
vi 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

yum clean all
yum update

 

- 위에 두가지 방법으로도 안될 경우

 yum -y upgrade ca-certificates
wget https://vault.centos.org/6.10/updates/x86_64/Packages/ca-certificates-2020.2.41-65.1.el6_10.noarch.rpm --no-check-certificate
 rpm -ivh ca-certificates-2020.2.41-65.1.el6_10.noarch.rpm
 rpm -e --nodeps ca-certificates-2015.2.6-65.0.1.el6_7.noarch
 rpm -ivh ca-certificates-2020.2.41-65.1.el6_10.noarch.rpm

 

여기까지 CentOS yum 설치 안될 때 해결 방법에 대하여 알아보았습니다.

 

도움이 되셨다면 구독좋아요

궁금하신 내용이 있으시면 댓글 부탁드립니다.

 

정리.txt
0.00MB

반응형

'IT > Linux' 카테고리의 다른 글

Ubuntu 22.04 기본설정  (0) 2022.05.31
Ubuntu 22.04 LTS 서버버전 설치  (0) 2022.05.31
리눅스 호스트네임 변경  (0) 2022.04.16
Apache + tomcat 8 설치 및 연동 (2)  (0) 2022.03.30
Apache + tomcat 8 설치 및 연동 (1)  (0) 2022.03.30
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기
});