YUM

Up: Tutorials

1. YUM의 기본사용법

YUM (Yellow Dog Update)은 Redhat linux에서 사용하는 RPM 설치를 개선하고자 만들어진 패키지 설치 관리자 프로그램이다.  CeontOS, Fedora 등의 리눅스 배포판에서 사용 가능하다. 

$ yum list installed

설치된 패키지가 화면에 모두 나열된다.  

yum list installed | grep PKGNAME

예를 들어 sympy 패키지가 설치되어 있으면 아래와 같이 정보를 준다.  

$ yum list installed | grep sympy

sympy.noarch            0.6.3-3.el6     @epel

Each field contains the following information:

More information of a package can be retrieved by 

yum info PKGNAME

$ yum info sympy

Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-

              : packagekit, security, tmprepo, verify, versionlock

Loading support for CentOS kernel ABI

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * epel: mirror.premi.st

 * extras: ftp.daumkakao.com

 * updates: ftp.daumkakao.com

Installed Packages

Name        : sympy

Arch        : noarch

Version     : 0.6.3

Release     : 3.el6

Size        : 12 M

Repo        : installed

From repo   : epel

Summary     : A Python library for symbolic mathematics

URL         : http://code.google.com/p/sympy/

License     : BSD

Description : SymPy aims to become a full-featured computer algebra system (CAS)

            : while keeping the code as simple as possible in order to be

            : comprehensible and easily extensible. SymPy is written entirely in

            : Python and does not require any external libraries.

To list available packages,

$ yum list available | more

Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-

              : packagekit, security, tmprepo, verify, versionlock

Loading support for CentOS kernel ABI

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * epel: mirror.premi.st

 * extras: ftp.daumkakao.com

 * updates: ftp.daumkakao.com

Available Packages

2048-cli.x86_64                             0.9.1-1.el6                  epel   

2048-cli-nocurses.x86_64                    0.9.1-1.el6                  epel   

2ping.noarch                                3.2.1-2.el6                  epel   

389-admin.i686                              1.1.35-1.el6                 epel   

...

To install a package,

yum install PKGNAME

To remove a package, 

yum remove PKGNAME

To update a package, 

yum update PKGNANME

To search a package whether it is installed or not, 

yum search PKGNAME

You may provide a partial name for search.

If you want to know which package a specific file belongs to, 

yum provides FNAME

$ yum provides  /etc/redhat-release 

centos-release-6-8.el6.centos.12.3.x86_64 : CentOS release file

Repo        : base

Matched from:

Filename    : /etc/redhat-release

centos-release-6-7.el6.centos.12.3.x86_64 : CentOS release file

Repo        : installed

Matched from:

Other       : Provides-match: /etc/redhat-release

To list enabled repositories, 

$ yum repolist 

Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-

              : packagekit, security, tmprepo, verify, versionlock

Loading support for CentOS kernel ABI

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * epel: mirror.premi.st

 * extras: ftp.daumkakao.com

 * updates: ftp.daumkakao.com

repo id          repo name                                                status

base             CentOS-6 - Base                                           6,696

epel             Extra Packages for Enterprise Linux 6 - x86_64           12,228

extras           CentOS-6 - Extras                                            62

updates          CentOS-6 - Updates                                          581

repolist: 19,567

To list all repositories whether enabled or not, 

$ yum repolist all

To query available packages from selected repository,

$ yum --disablerepo="*" --enablerepo="extras" list available

Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-

              : packagekit, security, tmprepo, verify, versionlock

Loading support for CentOS kernel ABI

Loading mirror speeds from cached hostfile

 * extras: ftp.daumkakao.com

Available Packages

bakefile.x86_64                                0.2.8-3.el6.centos         extras

centos-release-cr.x86_64                       10:6-0.el6.centos          extras

centos-release-gluster36.noarch                1.0-3.el6.centos           extras

centos-release-gluster37.noarch                1.0-4.el6.centos           extras

centos-release-gluster38.noarch                1.0-1.el6.centos           extras

centos-release-openstack.noarch                juno-2.el6                 extras

centos-release-scl.noarch                      10:7-3.el6.centos          extras

centos-release-scl-rh.noarch                   2-3.el6.centos             extras

centos-release-storage-common.noarch           1-2.el6.centos             extras

centos-release-virt-common.noarch              1-1.el6.centos             extras

centos-release-xen.x86_64                      10:8-2.el6                 extras

centos-release-xen-44.x86_64                   10:8-2.el6                 extras

centos-release-xen-46.x86_64                   10:8-2.el6                 extras

centos-release-xen-common.x86_64               10:8-2.el6                 extras

...

To install a group of packages, 

yum groupinstall 'GROUP PKG NAME'

To update a group of packages, 

yum groupupdate 'GROUP PKG NAME'

To remove a group of packages, 

yum groupremove 'GROUP PKG NAME'

Up: Tutorials