본문 바로가기
Technical/System

CentOS 6 에서 yum 오류 해결방법 [removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt]

by 알 수 없는 사용자 2021. 4. 23.

운용중인 서버는 Centos 6.10 이며 yum update 또는 search , install 전부 정상 동작 하지 않는 상태 입니다.

 

[root@dh-1812 ]# yum update
Loaded plugins: fastestmirror, security
Setting up Update Process
Determining fastest mirrors
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/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base
[root@dh-1812 ]#
[root@dh-1812 ]#
[root@dh-1812 ]# yum install nmap
Loaded plugins: fastestmirror, security
Setting up Install Process
Determining fastest mirrors
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/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base
[root@dh-1812 ]#
[root@dh-1812 ]#

 

아래 명령어 복붙.

echo "https://vault.centos.org/6.10/os/x86_64/" > /var/cache/yum/x86_64/6/base/mirrorlist.txt

echo "https://vault.centos.org/6.10/extras/x86_64/" > /var/cache/yum/x86_64/6/extras/mirrorlist.txt

echo "https://vault.centos.org/6.10/updates/x86_64/" > /var/cache/yum/x86_64/6/updates/mirrorlist.txt

 

 

[root@dh-1812 ]#
[root@dh-1812 ]# echo "https://vault.centos.org/6.10/os/x86_64/" > /var/cache/yum/x86_64/6/base/mirrorlist.txt
[root@dh-1812 ]# echo "https://vault.centos.org/6.10/extras/x86_64/" > /var/cache/yum/x86_64/6/extras/mirrorlist.txt
[root@dh-1812 ]# echo "https://vault.centos.org/6.10/updates/x86_64/" > /var/cache/yum/x86_64/6/updates/mirrorlist.txt
[root@dh-1812 ]#
[root@dh-1812 ]#
[root@dh-1812 ]#
[root@dh-1812 ]# yum install nmap
Loaded plugins: fastestmirror, security
Setting up Install Process
Determining fastest mirrors
epel/metalink | 4.7 kB 00:00
Could not retrieve mirrorlist https://mirrors.iuscommunity.org/mirrorlist?repo=ius-centos6&arch=x86_64&protocol=http error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.iuscommunity.org'"
* epel: d2lzkl7pfhq30w.cloudfront.net
base | 3.7 kB 00:00
epel | 4.7 kB 00:00
epel/primary_db | 6.1 MB 00:00
extras | 3.4 kB 00:00
extras/primary_db | 29 kB 00:00
ius | 1.3 kB 00:00
ius/primary | 134 B 00:00
updates | 3.4 kB 00:00
updates/primary_db | 12 MB 00:08
Package 2:nmap-5.51-6.el6.x86_64 already installed and latest version

 

임시로 mirrorlist.txt에 해결은 보았지만. 영구적으로 해결 한게 아니기에

/etc/yum.repos.d/ 디렉토리의 CentOS-Base.repo 에 추가 등록 해줘야 합니다.

 

 

댓글