yum 설치 후 repolist:0 오류

Eric Jung·2022년 11월 10일
0

기분 좋게 yum 설치 다 된 줄 알았는데 repolist 에 아무것도 없이 그냥 yum 만 깔렸다.

sudo apt install yum 하면 진짜 딱 yum만 깔리는 경우.
yum install *** 혹은 yum update를 하면
아무것도 없다고 아무것도 안해준다.
왜냐면 yum 은 repository url 을 읽어서,
그 url에 있는 파일들을 다운로드 후 설치해주는 프로그램이니,
repository url 이 없다면 아무것도 할 수 없다.
한 블로그에서 해결법을 찾았다. (https://jangpd007.tistory.com/257)

인용문.

sudo su
명령어로 ubuntu@주소 -> root@주소 로 유저전환을 해주고,

cd /etc/yum.repos.d
vi daum.repo

해야하는데,

yum.repos.d가 아니라
yum/repos.d 였다.
나도...!


[base]
name=CentOS-releaseverBasebaseurl=http://ftp.daum.net/centos/7/os/releasever - Base baseurl=http://ftp.daum.net/centos/7/os/basearch/
gpgcheck=1
gpgkey=http://ftp.daum.net/centos/RPM-GPG-KEY-CentOS-7

[updates]
name=CentOS-releaseverUpdatesbaseurl=http://ftp.daum.net/centos/7/updates/releasever - Updates baseurl=http://ftp.daum.net/centos/7/updates/basearch/
gpgcheck=1
gpgkey=http://ftp.daum.net/centos/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS-releaseverExtrasbaseurl=http://ftp.daum.net/centos/7/extras/releasever - Extras baseurl=http://ftp.daum.net/centos/7/extras/basearch/
gpgcheck=1
gpgkey=http://ftp.daum.net/centos/RPM-GPG-KEY-CentOS-7

[centosplus]
name=CentOS-releaseverPlusbaseurl=http://ftp.daum.net/centos/7/centosplus/releasever - Plus baseurl=http://ftp.daum.net/centos/7/centosplus/basearch/
gpgcheck=1
gpgkey=http://ftp.daum.net/centos/RPM-GPG-KEY-CentOS-7


이 글들을 붙여넣으면 된다.

파일이름은 daum.repo 가 아니어도 된다.

yum 이 읽을 파일을 선정하는 규칙이 *.repo이기 때문에,

파일 명의 확장자가 .repo이면 된다.

링크를 읽으면 알겠지만, centos 7 속에 들어있는 yum 필수 파일들이다.
필자는 oracle 에서 ubuntu 환경인데도 불구하고,
centos 7 의 파일들을 불러와서 설치했는데 호환이 됐다.

그리고

sudo yum update
를 해주면 다 설치 된다.

sudo yum list 를 했을때 촤르르르르륵 설치된 rpm들이 펼쳐진다.

혹은 mirrorlist.txt 를 찾을 때가 있다.

이 한줄만 /var/cache/yum/base/mirrorlist.txt 와 같은 해당 경로에 넣어주면 된다.

다시 정리하자면,

yum 은 repo 파일 속 적힌 링크를 통해 다운로드를 받는다.

우리가 여기서 사용한 OS는 Ubuntu이지만,

CentOS에서 제공하는 프로그램들을 다운 받아서 쓰는 것이다.

실제 저 링크들을 클릭해보면 CentOS 에서 쓰는 Yum 관련 실행파일들이 OS 조건에 따라 여러 경로에 나눠져 들어있다.

(64비트 86비트, 6버전 7버전 등등)

만약 위와 같은 설정이 먹히지 않을 시, centos 나 64 / 86 비트 수를 조정해가며 시도해볼 수 있겠다.






출처 : https://gogoonbuntu.tistory.com/17

profile
Developer

0개의 댓글