1. 개요
레드햇 리눅스나 CentOS 를 사용하면 패키지 관리를 위하여 yum 을 사용할 일이 정말 많다. yum이 없던 시절에 (혹은 내가 yum의 존재를 모르던 시절에) rpm 을 하나하나 깔던 기억이 난다.
a라는 패키지 설치를 하다가 의존성에 의존성에 따라 z 패키지를 깔던 일도 있었다. 그렇게 다시 a를 설치할 수 있었을 때는 정말 소리를 지르지 않을 수 없었다.
2. yum이란?
yum은 yellow dog updater, modified의 약자이다. yum의 공식 홈페이지는 yum.baseurl.org이다.
듀크 대학교의 linux@duke 프로젝트의 일부로 개발되었다고 한다. 듀크 대학교는 미국에 있는 대학교인데 노스캐롤라이나 주에 있는 사립대학교라고 한다. 1838년에 개교하였다니 정말 오랜 역사를 자랑한다. 1838년은 조선시대 헌종 4년이다.
yumex라는 gui 기반도 있다는데 사용해 본 적은 없다. 설치는 yum install yumex-nextgen하면 된다. 혹은 sourceforge 에서 얻을 수도 있다. http://sourceforge.net/projects/yumex/ 이다.
3. 옵션
이제 yum 의 주요한 옵션을 예제와 함께 살펴본다.
3-1. yum install
패키지를 설치할 때 사용한다.
openssl 을 설치하여 보겠다.
# yum install openssl Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.tsukuba.wide.ad.jp * extras: ftp.riken.jp * updates: ftp.riken.jp base | 3.7 kB 00:00 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 2.6 MB 00:01 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package openssl.x86_64 0:1.0.1e-16.el6_5.4 will be updated --> Processing Dependency: openssl = 1.0.1e-16.el6_5.4 for package: openssl-devel-1.0.1e-16.el6_5.4.x86_64 ---> Package openssl.x86_64 0:1.0.1e-16.el6_5.7 will be an update --> Running transaction check ---> Package openssl-devel.x86_64 0:1.0.1e-16.el6_5.4 will be updated ---> Package openssl-devel.x86_64 0:1.0.1e-16.el6_5.7 will be an update --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================== Package Arch Version Repository Size ======================================================================================================================== Updating: openssl x86_64 1.0.1e-16.el6_5.7 updates 1.5 M Updating for dependencies: openssl-devel x86_64 1.0.1e-16.el6_5.7 updates 1.2 M Transaction Summary ======================================================================================================================== Upgrade 2 Package(s) Total download size: 2.7 M Is this ok [y/N]: y Downloading Packages: (1/2): openssl-1.0.1e-16.el6_5.7.x86_64.rpm | 1.5 MB 00:01 (2/2): openssl-devel-1.0.1e-16.el6_5.7.x86_64.rpm | 1.2 MB 00:01 ------------------------------------------------------------------------------------------------------------------------ Total 1.1 MB/s | 2.7 MB 00:02 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : openssl-1.0.1e-16.el6_5.7.x86_64 1/4 Updating : openssl-devel-1.0.1e-16.el6_5.7.x86_64 2/4 Cleanup : openssl-devel-1.0.1e-16.el6_5.4.x86_64 3/4 Cleanup : openssl-1.0.1e-16.el6_5.4.x86_64 4/4 Verifying : openssl-1.0.1e-16.el6_5.7.x86_64 1/4 Verifying : openssl-devel-1.0.1e-16.el6_5.7.x86_64 2/4 Verifying : openssl-1.0.1e-16.el6_5.4.x86_64 3/4 Verifying : openssl-devel-1.0.1e-16.el6_5.4.x86_64 4/4 Updated: openssl.x86_64 0:1.0.1e-16.el6_5.7 Dependency Updated: openssl-devel.x86_64 0:1.0.1e-16.el6_5.7 Complete!
3-2. yum reinstall
패키지를 다시 설치한다.
# yum reinstall openssl Loaded plugins: fastestmirror Setting up Reinstall Process Loading mirror speeds from cached hostfile * base: ftp.tsukuba.wide.ad.jp * extras: ftp.riken.jp * updates: ftp.riken.jp Resolving Dependencies --> Running transaction check ---> Package openssl.x86_64 0:1.0.1e-16.el6_5.7 will be reinstalled --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================== Package Arch Version Repository Size ======================================================================================================================== Reinstalling: openssl x86_64 1.0.1e-16.el6_5.7 updates 1.5 M Transaction Summary ======================================================================================================================== Reinstall 1 Package(s) Total download size: 1.5 M Installed size: 4.0 M Is this ok [y/N]: y Downloading Packages: openssl-1.0.1e-16.el6_5.7.x86_64.rpm | 1.5 MB 00:01 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : openssl-1.0.1e-16.el6_5.7.x86_64 1/1 Verifying : openssl-1.0.1e-16.el6_5.7.x86_64 1/1 Installed: openssl.x86_64 0:1.0.1e-16.el6_5.7 Complete!
3-3. yum update
패키지를 업데이트한다.
# yum update openssl Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.tsukuba.wide.ad.jp * extras: ftp.riken.jp * updates: ftp.riken.jp Setting up Update Process No Packages marked for Update
위의 예는 업데이트 할 것이 없다.
그래서 curl 을 yum update 해보겠다.
# yum update curl Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.tsukuba.wide.ad.jp * extras: ftp.riken.jp * updates: ftp.riken.jp Setting up Update Process Resolving Dependencies --> Running transaction check ---> Package curl.x86_64 0:7.19.7-26.el6_2.4 will be updated ---> Package curl.x86_64 0:7.19.7-37.el6_4 will be an update --> Processing Dependency: libcurl = 7.19.7-37.el6_4 for package: curl-7.19.7-37.el6_4.x86_64 --> Running transaction check ---> Package libcurl.x86_64 0:7.19.7-26.el6_2.4 will be updated ---> Package libcurl.x86_64 0:7.19.7-37.el6_4 will be an update --> Processing Dependency: libssh2(x86-64) >= 1.4.2 for package: libcurl-7.19.7-37.el6_4.x86_64 --> Running transaction check ---> Package libssh2.x86_64 0:1.2.2-7.el6_2.3 will be updated ---> Package libssh2.x86_64 0:1.4.2-1.el6 will be an update --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================== Package Arch Version Repository Size ======================================================================================================================== Updating: curl x86_64 7.19.7-37.el6_4 base 193 k Updating for dependencies: libcurl x86_64 7.19.7-37.el6_4 base 165 k libssh2 x86_64 1.4.2-1.el6 base 122 k Transaction Summary ======================================================================================================================== Upgrade 3 Package(s) Total download size: 480 k Is this ok [y/N]: y Downloading Packages: (1/3): curl-7.19.7-37.el6_4.x86_64.rpm | 193 kB 00:00 (2/3): libcurl-7.19.7-37.el6_4.x86_64.rpm | 165 kB 00:00 (3/3): libssh2-1.4.2-1.el6.x86_64.rpm | 122 kB 00:00 ------------------------------------------------------------------------------------------------------------------------ Total 557 kB/s | 480 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : libssh2-1.4.2-1.el6.x86_64 1/6 Updating : libcurl-7.19.7-37.el6_4.x86_64 2/6 Updating : curl-7.19.7-37.el6_4.x86_64 3/6 Cleanup : curl-7.19.7-26.el6_2.4.x86_64 4/6 Cleanup : libcurl-7.19.7-26.el6_2.4.x86_64 5/6 Cleanup : libssh2-1.2.2-7.el6_2.3.x86_64 6/6 Verifying : libssh2-1.4.2-1.el6.x86_64 1/6 Verifying : curl-7.19.7-37.el6_4.x86_64 2/6 Verifying : libcurl-7.19.7-37.el6_4.x86_64 3/6 Verifying : libcurl-7.19.7-26.el6_2.4.x86_64 4/6 Verifying : libssh2-1.2.2-7.el6_2.3.x86_64 5/6 Verifying : curl-7.19.7-26.el6_2.4.x86_64 6/6 Updated: curl.x86_64 0:7.19.7-37.el6_4 Dependency Updated: libcurl.x86_64 0:7.19.7-37.el6_4 libssh2.x86_64 0:1.4.2-1.el6 Complete!
3-4. yum upgrade
패키지를 업그레이드한다.
# yum upgrade openssl Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.tsukuba.wide.ad.jp * extras: ftp.riken.jp * updates: ftp.riken.jp Setting up Upgrade Process No Packages marked for Update
위의 예는 업데이트 할 것이 없다.
3-5. yum erase (remove)
패키지를 제거한다.
# yum erase openssl Loaded plugins: fastestmirror Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package openssl.x86_64 0:1.0.1e-16.el6_5.7 will be erased ...
사실 erase 는 잘 안된다.