본문 바로가기
OS 운영체제/LINUX

rpm과 yum (패키지 설치 도구)

by yororing 2024. 4. 26.

00 개요

  • Linux 환경에서 설치를 하다 보면 .rpm, rpm, yum, repository, yum.repos.d, .repo 등 비슷한 용어들을 접할 것이다
  • 각 용어가 뭘 뜻하는지 정리하고자 한다

01 용어

0. <패키지이름>.rpm

  • <패키지이름>.rpm은 어떤 소프트웨어의 패키지이다 
  • contains the files in CPIO archive (similar to tar, just different format) and some info (e.g. which other packages it needs) and scripts which needs to be run when package is installed/upgraded/removed (those are automatically run by /usr/bin/rpm)

1. repository

  • typical distribution (RHEL) is made of thousands of RPM packages
  • they are grouped in one directory called repository
  • Red Hat provides some base repository
  • Then there are some other repositories with some products (e.g all packages needed for OpenStack or Satellite or something else)

2. rpmyum (명령어)

  • rpm 과 yum 모두 Redhat 계열 Linux 배포판에서 사용하는 패키지를 설치하는 도구이다

1) rpm (Redhat Package Manager)

# 문법
rpm [option] [packagefile]
rpm [option] [packagefile1] [packagefile2] [packagefile3] ...
  • 프로그램을 설치한 후 바로 실행할 수 있는 패키지 설치 관리 도구 (windows의 setup.exe와 비슷한 개념)
  • /usr/bin/rpm
  • 패키지들을 하나 하나 명시해줘서 설치
  • 단점: 의존성 문제
    • 패키지1을 설치하려면 패키지2가 필요하여 패키지2를 설치하려고 하면 패키지3이 필요, and so on...
    • 이럴 경우 패키지n 설치 후 → 패키지3 설치 후 → 패키지2 설치 후 → 패키지1 설치해야함
    • 의존성이 많을 경우 굉장히 번거로움

2) yum (Yellowdog Update Modified)

# 문법
yum [option] [package name]
  • 프로그램을 설치한 후 바로 실행할 수 있는 패키지 설치 관리 도구 (windows의 setup.exe와 비슷한 개념)
  • /usr/bin/yum
  • 자동으로 필요한 패키지들까지 설치
  • 장점: 의존성 문제 해결
  • 사용 방법:
    • 인터넷 연결이 가능한 환경이라면 인터넷 사용
    • 폐쇄망에서도 사용 가능 - ISO 파일을 다운받아 사용 가능
  • yum 설정 파일:
    • /etc/yum.conf
      • 딱히 수정할 필요 X
    • /etc/yum.repos.d/<레포지토리명>.repo
      • yum 명령을 입력했을 때 검색하게 되는 네트워크 주소 또는 파일 경로가 들어있음

참조

  1. https://wlstnans.tistory.com/3 
  2. https://superuser.com/questions/1190269/relationship-between-yum-repo-and-rpm
  3. https://codereader37.tistory.com/40
  4. (rpm)https://dololak.tistory.com/312
  5. (yum)https://dololak.tistory.com/331 
  6.  
  7.  
  8.