프로그래밍/IT용어정리

[centos] yum 설치 및 E: Unable to locate package yum 해결방법

피타챈 2023. 6. 20. 13:51

centos 환경에서 yum 으로 postgresql 을 설치하려고했더니, yum 명령어 실행하면 command not found 라고 뜸

 

환경구성하고 난 민짜상태여서 yum이 설치가 안되있다.

 

 

이 분이 글을 잘 정리해주셔서 보고 따라했더니 해결

참고: https://integer-ji.tistory.com/370

 

[Linux] E: Unable to locate package yum

* 해당 글을 작성하기 위해 새로운 인스턴스를 생성하여 IP가 노출됩니다. 게시 완료 후 인스턴스는 종료 예정입니다! 새로운 인스턴스 환경에는 yum이 없다는 걸 알고 설치를 하니 해당 에러가

integer-ji.tistory.com

내용은 같으니, 필요하신분들은 위 블로그에서 확인하기를 추천.

 

나는 내가 기억하기위해 같은내용이지만 정리를 해두겠다.

 

1) yum 실행 하면 command not found가 나온다. (postgresql 설치 시도)

root@tmax:~# sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo
sudo: yum: command not found

 

2) 머여,, yum 설치 안되있는 환경이군 설치 진행시켯~! 

root@tmax:~# sudo apt install yum

 - Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package yum

 

..띠로리..안된다.. 위 내용을 해결해보자!

 

 

3) /etc/apt/sources.list 수정 (파일 백업 해두고 하자)

root@tmax:~# pwd
/root
root@tmax:~# cd ..
root@tmax:/# cd etc/apt/
root@tmax:/etc/apt# vi sources.list

 

4) source.list 맨 하단에 아래내용추가

deb http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse

 

5) yum 설치 시도

root@tmax:/etc/apt# sudo apt install yum
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 yum : Depends: python-lzma but it is not going to be installed
       Depends: python-sqlitecachec but it is not going to be installed
       Depends: python-urlgrabber but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

 

6) 파이썬 뭐시기도 추가로 설치해줘야하나봄 차례대로 설치해준다.

 

7) Do you want to continue? [Y/n] 나오면 다 Y 입력하자

root@tmax:/etc/apt# sudo apt install python-lzma
root@tmax:/etc/apt# sudo apt install python-sqlitecachec
root@tmax:/etc/apt# sudo apt install python-pycurl
root@tmax:/etc/apt# sudo apt install python-urlgrabber

 

8) 위내용 하나씩 설치해주고  yum 설치해주면 끝! 이제 얌 쓸수있다냠!

root@tmax:/etc/apt# sudo apt install yum

 

얌설치 끝!! 이제 postgre15.3 을 설치해보자!