[Linux][CentOS 5.7] yum 사용할 시 'YumRepo Error: All mirror URLs are not using ftp, http[s] or file.' 에러 해결방법
환경
OS: CentOS 5.7 64bit
증상
git을 설치하기 위해 yum 실행하면 아래와 같이 에러가 발생한다.
1004lucifer
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/
removing mirrorlist with no valid mirrors: /var/cache/yum/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base
[root@localhost ~]#
해결방법
yum을 통해 받을 미러리스트가 없어서 정상적으로 수행되지 못했다.
미러리스트를 만들어주면 된다.
(5.7 과 같은 버전은 본인의 CentOS 버전에 맞게 수정해 주면 된다.)
[root@localhost ~]# echo "http://vault.centos.org/5.7/extras/x86_64/" > /var/cache/yum/extras/mirrorlist.txt
[root@localhost ~]# echo "http://vault.centos.org/5.7/updates/x86_64/" > /var/cache/yum/updates/mirrorlist.txt
나같은경우 처음에 디렉토리가 없어서 그런지 명령어 수행 시 디렉토리가 없다고 나오다가 'yum install git' 한번씩 수행하면 디렉토리가 만들어 지는지..
그 다음에서야 명령어가 정상적으로 수행이 되었다.
1004lucifer
[root@localhost ~]#
[root@localhost ~]# yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/
removing mirrorlist with no valid mirrors: /var/cache/yum/extras/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: extras
[root@localhost ~]#
[root@localhost ~]# echo "http://vault.centos.org/5.7/extras/x86_64/" > /var/cache/yum/extras/mirrorlist.txt
[root@localhost ~]#
[root@localhost ~]# yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/
removing mirrorlist with no valid mirrors: /var/cache/yum/updates/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: updates
[root@localhost ~]#
[root@localhost ~]# echo "http://vault.centos.org/5.7/updates/x86_64/" > /var/cache/yum/updates/mirrorlist.txt
[root@localhost ~]#
[root@localhost ~]# yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 1.1 kB 00:00
base/primary | 1.2 MB 00:04
base 3566/3566
extras | 2.1 kB 00:00
extras/primary_db | 206 kB 00:02
updates | 1.9 kB 00:00
updates/primary_db | 668 kB 00:06
Setting up Install Process
No package git available.
Nothing to do
[root@localhost ~]#
참고
- https://www.linuxquestions.org/questions/centos-111/yumrepo-error-centos-5-9-a-4175604669/
댓글
댓글 쓰기