Search Results for 'RPM 사용법'

1 POSTS

  1. 2008.10.24 RPM 사용법

RPM 사용법

Posted 2008. 10. 24. 04:40

출처 : Tong - e돌람바님의 OS통

1. RPM의 개요 

리눅스 배포판들은 기본적으로 package라는 단위로 구성되어있다. 일반적인 .tar.gz(.tgz)파일보다 RPM패키지는 매우 뛰어난 기능을 가지고 있는 고차원적인 패키징 시스템이다.

1.1 rpm의 다섯가지 mode

■ 설치모드 : rpm -i 또는 rpm -U(업그레이드)

■ 제거모드 : rpm -e

■ 질의모드 : rpm -q

■ 검증모드 : rpm -V 또는 rpm -v

■ 패키지제작모드 : rpm -b

1.2 rpm 패키지 이름 구조

패키지 이름

-

버전

-

릴리즈

.

아키텍처

.

rpm

예) tcp_wrappers-7.6-10.i386.rpm
     tcp_wrappers : 패키지 이름
     7.6 : 버전
     10 : 릴리즈
     i386 : 아키텍처(intel 플랫폼의미)
    1.3 패키지 설치/업그레이드/제거

1.3 rpm패키지 명령어 형식

설치

 rpm -i [옵션] [패키지 파일 목록]

업그레이드

 rpm -U [옵션] [패키지 파일 목록]

질의

 rpm -q [옵션] [패키지 목록]

삭제

 rpm -e [패키지 이름]
 rpm -e [패키지 이름-버전]
 rpm -e [패키지 이름-버전-릴리즈]

검증

 rpm -V [옵션] [패키지 목록]
 rpm -y [옵션] [패키지 목록]


1.4. RPM 설치 / 업그레이드

1) 간단한 설치 명령

shell> rpm -i  proftpd-1.2.1-1kr.i686.rpm
shell>

2) -v 옵션

shell> rpm -i -v apache-1.3.12-2.i386.rpm
apache-1.3.12-2

shell>

3) -h, --hash옵션

shell> rpm -ivh apache-1.3.12-2.i386.rpm
apache        ###############################################
shell>

4) -Uvh

설치옵션에서 -i에 -v 옵션 하나, 그리고 진행상황을 행서 마크로 보여주는 -h옵션을 묶어 -ivh라는 복합옵션을 사용할 수 있다. 그러나, 많은 사용자들은 -ivh옵션 대신 -U옵션을 사용한다. 업그레이드 옵션 -U로 시스템에 설치된 패키지를 설치할 때는 업그레이드할 패키지가 없으므로 알아서 처음 설치 모드, 즉 -i모드로 설치하는 것과 바 없다. 구버전의 패키지가 있는경우 버전의 패키지를 지워주고 삭제와 설치를 동시에 해 주는 것이다.

아래의 예처럼 업그레이드 설치가 가능하며 중복 설치시엔  에러 메시지를 보내준다.

shell> rpm -Uvh apache-1.3.12-2.i386.rpm
apache     ##################################################
shell>

 

shell> rpm -Uvh apache-1.3.12-2.i386.rpm
package apache-1.3.12-2 is already installed
shell>

1.5 RPM 질의

아래와 같은 옵션으로 설치된 RPM패키지에 대한 정보를 알 수 있다.

1) 모든 설치 정보

shell> rpm -q -a 또는 rpm -qa
ElectricFence-2.1-1
setup-2.0.5-1
filesystem-1.3.5-1
basesystem-6.0-4
ldconfig-1.9.5-15

<생략 >

2) 패키지에 대한 질의

shell> rpm -q apache
apache-1.3.12-2
shell>

3) 일반정보 질의 -i

shell> rpm -qi apache
Name        : apache                       Relocations: (not relocateable)
Version     : 1.3.12                            Vendor: Red Hat, Inc.
Release     : 2                             Build Date: Thu 02 Mar 2000 03:37:55AM KST
Install date: Sat 17 Mar 2001 12:25:13 AM KST      Build Host: porky.devel.redhat.com
Group       : System Environment/Daemons    Source RPM: apache-1.3.12-2.src.rpm
Size        : 975071                           License: Freely distributable and usable
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary     : The most widely used Web server on the Internet.
Description :Apache is a powerful, full-featured, efficient and freely-available Web server. Apache is also the most popular Web server on the Internet. Install the apache package if you need a Web server.
shell>

4) 설치파일목록 질의 -ㅣ

shell> rpm -ql apache
/etc/httpd/conf
/etc/httpd/conf/access.conf
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/magic
<중 략>
shell>

1.6 RPM 삭제

shell> rpm -e apache
shell>

1.7 RPM 검증

설치한 패키지의 파일이 처음 설치할 때와 검즈을 하는 현재 시점 사이에 어떤 변화가 있었는지 검증 할 수 있다.

검    증    문    자

 설     명

 5

 MD5 체크섬(파일의 내용이 원본과 같은가?

 S

 파일크기

 L

 심볼릭 링크

 T

 최신 갱신일시(MTime)

 D

 장치

 U

 사용자

 G

 그룹

 M

 모드(허가권과 파일 유형)

 

shell> rpm -V proftpd
S.5....T c /etc/proftpd/conf/proftpd.conf
shell>

크기(s), 파일의 내용(5), 최신 갱신 일시(T) 가 다름을 나타낸다. c는 configuration 파일을 의미한다.