[Linux] 지원 종료된 CentOS 6 yum 사용시 YumRepo Error: All mirror URLs are not using ftp, http[s] or file. 에러발생
Linux 2022. 4. 6. 15:30
2020년 11월 30일에 지원종료된 CentOS 6를 어떻게든 끌고 가야하는데,
지원이 종료되었으므로 repo도 날아가서 yum 을 못 쓰는 상황.
CentOS vault mirror(http://vault.centos.org/)를 사용하면 되긴 하는데 느리다.
그리고 http로 요청해도 https 로 리다이렉트 되는데 curl 구버전에서 NSS error -12190 TLS handshake 에러가 발생하는 등 총체적 난국의 상황이 오므로 http 로 제공해주는데가 필요함.
찾아보니까 CERN(http://linuxsoft.cern.ch/centos-vault/)에서도 제공하고 있고 아직 여기저기 제공하고 있는데,
전부 속도가 느린 편이고 그나마 가장 빠른게 현재 상황에선 Internet Initiative Japan(http://ftp.iij.ad.jp/pub/linux/centos-vault/)에서 제공하는 mirror.
여하튼 iij에서 제공하는 repo를 이용하는 방법은 아래와 같음.
### 우선 기존 repo 파일명 변경
[root@bloodguy:/]# mv /etc/yum.repos.d/CentOS-Base.repo{,.old}
### 새 파일 생성
[root@bloodguy:/]# vi /etc/yum.repos.d/CentOS-Base.repo
### 생성된 파일에 아래 내용 입력
[base]
name=CentOS-$releasever - Base
baseurl=http://ftp.iij.ad.jp/pub/linux/centos-vault/centos/$releasever/os/$basearch/
gpgcheck=0
priority=1
protect=1
[update]
name=CentOS-$releasever - Updates
baseurl=http://ftp.iij.ad.jp/pub/linux/centos-vault/centos/$releasever/updates/$basearch/
gpgcheck=0
priority=1
protect=1
[extras]
name=CentOS-$releasever - Extras
baseurl=http://ftp.iij.ad.jp/pub/linux/centos-vault/centos/$releasever/extras/$basearch/
gpgcheck=0
priority=1
protect=1
### 캐시 날리기
[root@bloodguy:/]# yum clean all
### 테스트
[root@bloodguy:/]# yum info httpd
Loaded plugins: fastestmirror, security
Determining fastest mirrors
base | 3.7 kB 00:00
base/primary_db | 4.7 MB 00:01
extras | 3.4 kB 00:00
extras/primary_db | 29 kB 00:00
update | 3.4 kB 00:00
update/primary_db | 12 MB 00:04
Available Packages
Name : httpd
Arch : x86_64
Version : 2.2.15
Release : 69.el6.centos
Size : 836 k
Repo : base
Summary : Apache HTTP Server
URL : http://httpd.apache.org/
License : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
: web server.
혹시나 기존에 설정된 repo 때문에 에러가 난다면 아래처럼 처리.
### 기존 repo 설정 때문에 에러 발생
[root@bloodguy:/]# yum info httpd
Loaded plugins: fastestmirror, security
Determining fastest mirrors
Could not retrieve mirrorlist http://apt.sw.be/redhat/el6/en/mirrors-rpmforge error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'apt.sw.be'"
base | 3.7 kB 00:00
base/primary_db | 4.7 MB 00:00
extras | 3.4 kB 00:00
extras/primary_db | 29 kB 00:00
http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'apt.sw.be'"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmforge. Please verify its path and try again
### apt.sw.be <- 여기가 뒤진 것이므로 여기 설정을 찾아 enabled=0 해주자.
[root@bloodguy:/]# grep -r apt.sw.be /etc/yum.repos.d/*
/etc/yum.repos.d/rpmforge.repo:baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
/etc/yum.repos.d/rpmforge.repo:mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
/etc/yum.repos.d/rpmforge.repo:baseurl = http://apt.sw.be/redhat/el6/en/$basearch/extras
/etc/yum.repos.d/rpmforge.repo:mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-extras
/etc/yum.repos.d/rpmforge.repo:baseurl = http://apt.sw.be/redhat/el6/en/$basearch/testing
/etc/yum.repos.d/rpmforge.repo:mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-testing
### rpmforge.repo 라는 파일의 설정이 범인. 까보자
[root@bloodguy:/]# vi /etc/yum.repos.d/rpmforge.repo
### 내용을 보면 enabled = 1 되어 있는 곳이 하나 있음. 0 으로 바꿔주면 해결.
### Name: RPMforge RPM Repository for RHEL 6 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1 <--------------------------------------------------------- 이놈
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/extras
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-extras
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/testing
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-testing
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-testing
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1