Yum

From 탱이의 잡동사니
Jump to navigation Jump to search

Overview

Linux command yum 사용법 정리.

Options

version

yum 의 버전정보를 표시한다. <source lang=bash> $ yum version </source>

help

도움말을 표시한다. <source lang=bash> $ yum help </source>

check

현재 설치된 패키지에 문제가 있는지 검사한다.

<source lang=bash> $ yum check [package] </source>

Example <source lang=bash> $ yum check $ yum check yum.noarch </source>

check-update

업데이트가 필요한지 검사한다.

<source lang=bash> $ yum check-update [package] </source>

Example <source lang=bash> $ yum check-update $ yum check-update yum.noarch </source>

clean

캐시된 정보를 삭제한다. all 옵션 추가시, 캐시된 모든 정보를 삭제한다. <source lang=bash> $ yum clean $ yum clean all </source>

deplist

패키지에 대한 의존성을 테스트한다. <source lang=bash> $ yum deplist [package] </source>

Example <source lang=bash> $ yum deplist curl </source>

distribution-synchronization/distro-sync

현재 설치되어 있는 패키지들의 정보를 등록된 저장소의 최신버전과 동기화한다. 패키지에 따라 업그레이드/다운그레이드가 이루어질 수 있다. <source lang=bash> $ yum distro-sync </source>

downgrade

설치된 패키지를 다운그레이드 한다. <source lang=bash> $ yum downgrade package1 [package2] </source>

install

패키지를 설치한다. <source lang=bash> $ yum install package1 [package2] [...] </source>

remove/erase

설치된 패키지를 삭제한다. <source lang=bash> $ yum remove | erase package1 [package2] [...] </source>

update

설치되어 있는 전체/특정 패키지의 업그레이드를 진행한다. 아무런 패키지를 지정하지 않을 경우, 전체 업그레이드를 진행한다. <source lang=bash> $ yum update [package1] [package2] [...] </source>

search

패키지의 설명, 이름을 검색한다. <source lang=bash> $ yum search string1 [string2] [...] </source>

groupinfo

그룹 패키지의 정보를 표시한다. <source lang=bash> $ yum groupinfo group1 [...] </source>

groupinstall

지정된 그룹에 속한 모든 패키지를 설치한다. <source lang=bash> $ yum groupinstall group1 [group2] [...] </source>

grouplist

설치 가능한 패키지 그룹의 리스트를 표시한다. <source lang=bash> $ yum grouplist [hidden] [groupwildcard] [...] </source>

groupremove

그룹에 속한 모든 패키지를 삭제한다. <source lang=bash> $ yum groupremove group1 [group2] [...] </source>

history

yum 패키지에 대한 최초 설치, 업데이트 등의 내역을 나타낸다. <source lang=bash> $ yum history [info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]

$ yum history Loaded plugins: auto-update-debuginfo ID | Login user | Date and time | Action(s) | Altered


  107 |  <stk>                 | 2016-03-16 14:59 | Update         |    1   
  106 |  <stk>                 | 2016-03-16 14:48 | Update         |    1   
  105 |  <stk>                 | 2016-03-14 15:43 | Update         |    1 EE
  104 |  <stk>                 | 2016-03-11 14:01 | Install        |    1   
  103 |  <stk>                 | 2016-03-11 14:00 | Install        |    2   
  102 |  <stk>                 | 2016-03-11 13:59 | Install        |    1   
  101 |  <stk>                 | 2016-03-11 13:29 | Update         |    1   
  100 |  <stk>                 | 2016-03-10 15:00 | Update         |    1 EE
   99 |  <stk>                 | 2016-03-08 15:05 | Install        |    1   
   98 |  <stk>                 | 2016-03-04 15:20 | Update         |   11 EE
   97 | root <root>            | 2016-03-01 11:42 | Update         |    1 EE
   96 |  <stk>                 | 2016-02-22 11:40 | Install        |    1   
   95 |  <stk>                 | 2016-02-22 11:40 | Update         |    1   
   94 |  <stk>                 | 2016-02-19 15:52 | Downgrade      |    1   
   93 |  <stk>                 | 2016-02-19 15:52 | Downgrade      |    1   
   92 |  <stk>                 | 2016-02-19 15:52 | Erase          |    1   
   91 |  <stk>                 | 2016-02-19 15:38 | I, U           |    7   
   90 |  <stk>                 | 2016-02-19 13:58 | Update         |    2   
   89 |  <stk>                 | 2016-02-19 10:55 | Downgrade      |    1   
   88 |  <stk>                 | 2016-02-19 10:55 | Downgrade      |    1   

history list </source>

list

입력한 패키지와 관련된 yum 명령 내역만 출력한다. <source lang=bash> $ yum history list <package-regex>

$ yum history list lib* Loaded plugins: auto-update-debuginfo ID | Login user | Date and time | Action(s) | Altered


  103 |  <stk>                 | 2016-03-11 14:00 | Install        |    2   
  101 |  <stk>                 | 2016-03-11 13:29 | Update         |    1   
   96 |  <stk>                 | 2016-02-22 11:40 | Install        |    1   

... </source>

info

history-number 에 해당하는 명령의 상세 내역을 확인한다. <source lang=bash> $ yum history info <history-number>

$ yum history info 10 Loaded plugins: auto-update-debuginfo Transaction ID : 10 Begin time  : Mon Nov 16 15:18:31 2015 Begin rpmdb  : 361:061e446b5581553ea6e8ce90e3a5856a394fecca End time  : (0 seconds) End rpmdb  : 362:e0b84597f8c98008043535c2ab4af412379cae43 User  : <stk> Return-Code  : Success Command Line  : install libuuid-devel Transaction performed with:

   Installed     rpm-4.7.2-2.fc12.x86_64
   Installed     yum-3.2.28-5.fc12.noarch

Packages Altered:

   Install libuuid-devel-2.16.2-9.fc12.x86_64

history info </source>

summary

마지막으로 수행한 작업 내용을 보여준다. <source lang=bash> $ yum history summary

$ yum history summary Loaded plugins: auto-update-debuginfo Login user | Time | Action(s) | Altered


<stk>                     | Last week           | Update           |        3
<stk>                     | Last 2 weeks        | I, U             |        7
<stk>                     | Last 3 months       | D, E, I, U       |       82

root <root> | Last 3 months | I, U | 14

<stk>                     | Last 6 months       | D, E, I, R, U    |      153

root <root> | Last 6 months | Install | 171 System <unset> | Over a year ago | Install | 159 history summary </source>

repeat

함께 입력한 history-number 에 해당하는 작업을 재수행한다. <source lang=bash> $ yum history repeat <history-number> </source>

undo

함께 입력한 history-number 에 해당하는 작업을 되돌린다. <source lang=bash> $ yum history unto <history-number>

$ yum history undo 108 Loaded plugins: auto-update-debuginfo Found 20 installed debuginfo package(s) Enabling updates-cached-debuginfo: Fedora 12 - x86_64 - Updates Debuginfo (cached) Reading repository metadata in from local files Enabling fedora-cached-debuginfo: Fedora 12 - x86_64 - Debuginfo (cached) Reading repository metadata in from local files Undoing transaction 108, from Fri Mar 18 16:08:32 2016

   Install lynx-2.8.6-25.fc12.x86_64

Resolving Dependencies --> Running transaction check ---> Package lynx.x86_64 0:2.8.6-25.fc12 set to be erased --> Finished Dependency Resolution ... </source>

redo

repeat 와 거의 비슷하다. 함께 입력한 history-numbrer 에 해당하는 작업을 다시 반복한다. <source lang=bash> $ yum history redo <history-number> </source>

new

현재 history 항목에 저장된 내용들을 모두 삭제한다.

info

현재 캐시되어 있는 패키지에 대한 정보를 보여준다. <source lang=bash> $ yum info [...] </source>

list

캐시에 등록된 패키지 목록을 보여준다. <source lang=bash> $ yum list [...] $ yum list updates $ yum list all $ yum list installed </source>

updates 업데이트가 가능한 모든 패키지 리스트를 보여준다.

list all 설치가 가능한 모든 패키지 리스트를 보여준다.

installed 현재 시스템에 설치된 패키지 리스트를 보여준다.

repolist

설정되어 있는 저장소 정보를 표시한다. <source lang=bash> $ yum repolist [all|enabled|disabled] </source>

Sub options

--enablerepo

활성화하고자 하는 저장소를 지정한다.

$ sudo yum search --enablerepo test-repository asterisk

yum-utils

repoquery

repoquery 는 YUM repository 에 있는 패키지에 rpm 명령어와 비슷한 명령을 수행하는 프로그램이다.

-l, --list

YUM repository 에 있는 패키지/그룹에 있는 파일들의 목록을 확인한다.

$ repoquery --list curl-7.29.0-4.fc12.x86_64
/usr/bin/curl
/usr/share/doc/curl-7.29.0
/usr/share/doc/curl-7.29.0/BUGS
...

Download source

SRPM 패키지 다운로드 <source lang=bash> $ yum install yum-utils $ yumdownloader --source mypkg </source>