server/linux
[CentOS6] Error: Cannot find a valid baseurl for repo: base
정유현
2022. 8. 2. 11:18
728x90
OS : CentOS 6.8
[root@localhost ~]# yum update
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
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
CentOS 6 버전 지원 종료로 인해 yum 관련 명령어에서 에러가 난다고 한다.
echo "https://vault.centos.org/6.8/os/x86_64/" >> /var/cache/yum/x86_64/6/base/mirrorlist.txt
echo "http://vault.centos.org/6.8/extras/x86_64/" >> /var/cache/yum/x86_64/6/extras/mirrorlist.txt
echo "http://vault.centos.org/6.8/updates/x86_64/" >> /var/cache/yum/x86_64/6/updates/mirrorlist.txt
위와 같이 미러리스트 추가(수정)하면 정상적으로 사용 가능해진다. 나같은 경우 이 문제를 해결하니 아래와같은 추가 문제가 발생했다.
[Errno 14] Peer cert cannot be verified or peer cert invalid
Trying other mirror.
위와같은 문제시 /etc/yum.conf 파일을 수정한다.
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
sslverify=false #추가
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
저장하고 reboot 하면 정상적으로 해결이 된다.
728x90