학습자료/리눅스 2013. 2. 1. 14:01

명령어 : rpm


1) 패키지가 설치 되어 있는지 확인

rpm -qa | grep <package name>

-qa 명령어만 사용하면 전체 설치 리스트를 가지고 오는데 여기에서 특정 이름만 추출하기 위해서 사용합니다.

rpm -qa | grep tftp-server // tftp-server 라는 패키지가 설치되어 있는지 확인


2) 패키지 제거하기

rpm -e tftp-server // tftp-server 패키지 제거

의존성 무시하고 강제 삭제를 원하는 경우

--nodeps 옵션을 추가하면 됩니다.


3) 패키지 설치 및 업그레이드

-i : 설치

-U : 업그레이드

-v : 설치 진행 상황 보여주기

--------------------------------------------------

질의 옵션 (-q 또는 --query 옵션과 함께 사용):
-c, --configfiles 모든 설정 파일을 나열합니다
-d, --docfiles 모든 문서 파일을 나열합니다
--dump 기본 파일 정보를 보여줍니다
-l, --list 패키지 안의 파일을 나열합니다
--queryformat=QUERYFORMAT 다음의 질의 형식을 사용하십시요
-s, --state 나열된 파일의 상태(state)를 보여줍니다
-a, --all 모든 패키지에 대해 질의/검증합니다
-f, --file 파일이 들어있는 패키지에 대해 질의/검증 합니다
-g, --group 그룹 안의 패키지를 질의/검증 합니다
-p, --package query/verify a package file
--specfile spec 파일에 대해 질의합니다
--whatrequires 의존성을 필요로 하는 패키지에 대해 질의/검증 합니다
--whatprovides 의존성을 제공하는 패키지에 대해 질의/검증 합니다


검증 옵션 (-V 또는 --verify 옵션과 함께 사용):
--nomd5 파일의 MD5 축약(digest)을 검사하지 않습니다
--nofiles 패키지 안의 파일을 검사하지 않습니다
--nodeps 패키지의 의존성을 검사하지 않습니다
--noscript don't execute verify script(s)
-a, --all 모든 패키지에 대해 질의/검증합니다
-f, --file 파일이 들어있는 패키지에 대해 질의/검증 합니다
-g, --group 그룹 안의 패키지를 질의/검증 합니다
-p, --package query/verify a package file
--specfile spec 파일에 대해 질의합니다
--whatrequires 의존성을 필요로 하는 패키지에 대해 질의/검증 합니다
--whatprovides 의존성을 제공하는 패키지에 대해 질의/검증 합니다


서명 옵션:
--addsign sign package(s) (identical to --resign)
-K, --checksig verify package signature(s)
--import import an armored public key
--resign sign package(s) (identical to --addsign)
--nodigest don't verify package digest(s)
--nosignature don't verify package signature(s)


데이터베이스 옵션:
--initdb 데이터베이스를 초기화 합니다
--rebuilddb 설치된 패키지 헤더에서 상반된 목록(inverted lists)의 데이터베이스를 재구축 합니다


설치/업그레이드/삭제 옵션:
--aid add suggested packages to transaction
--allfiles 특정 파일을 생략하기 위한 설정이 적용된
경우에도, 패키지 안의 모든 파일을 설치합니다
--allmatches <패키지> 이름과 일치하는 패키지는 모두
제거합니다 (<패키지>에 여러개의 패키지를 동시에

지정할 경우에는 오류가 발생합니다)
--badreloc relocate files in non-relocatable package
-e, --erase=<패키지>+ 패키지를 (제거) 삭제합니다
--excludedocs 패키지에 포함된 문서 파일을 설치하지 않습니다
--excludepath=<경로> <경로>로 시작되는 파일은 설치하지 않습니다
--fileconflicts detect file conflicts between packages
--force --replacepkgs 와 --replacefiles 옵션을 동시에 사용합니다
-F, --freshen=<패키지파일>+ 기존에 설치된 패키지를 업그레이드 합니다
-h, --hash 패키지 설치를 해시마크(#)로 표시합니다 (-v 옵션과 함께 사용하는 것이 좋습니다)
--ignorearch 패키지의 아키텍쳐를 검사하지 않습니다
--ignoreos 패키지의 운영체제를 검사하지 않습니다
--ignoresize 패키지를 설치하기 전에 디스크 공간을 검사하지 않습니다
-i, --install install package(s)
--justdb 파일시스템을 변경하지 않고, 데이터베이스를 갱신합니다
--nodeps 패키지의 의존성을 검사하지 않습니다
--nomd5 파일의 MD5 축약(digest)을 검사하지 않습니다
--noorder 의존성이 있는 패키지를 설치하도록 재요구하지 않습니다
--nosuggest do not suggest missing dependency resolution(s)
--noscripts 패키지 스크립틀릿(scriptlet)을 실행하지 않습니다
--notriggers 이 패키지에 의해 생성되는(triggered) 어떠한 스크립틀릿(scriptlet)도 실행하지 않습니다
--oldpackage 이전 버전의 패키지로 다운그레이드 합니다
(--force 옵션을 사용시에는 이 옵션이 자동으로 적용됩니다)
--percent 패키지 설치를 퍼센트(%)로 표시합니다
--prefix=<디렉토리> 재배치 기능이 있는 패키지의 경우, 지정한<디렉토리>로 재배치하여 설치합니다
--relocate=<이전경로>=<새로운경로> <이전경로>에서 <새로운경로>로 파일을 재배치 합니다
--repackage 재패키징(repackaging)으로 인해 삭제되는 패키지 파일을 저장합니다
--replacefiles ignore file conflicts between packages
--replacepkgs 패키지가 이미 설치되어 있는 경우에도 설치합니다
--test 패키지를 설치하지 않고, 제대로 설치되는지만 확인합니다
-U, --upgrade=<패키지파일>+ 패키지를 업그레이드 합니다


모든 rpm 모드에서의 일반적인 옵션:
-D, --define='MACRO EXPR' define MACRO with value EXPR
-E, --eval='EXPR' print macro expansion of EXPR
--macros=<FILE:...> read <FILE:...> instead of default file(s)
--nodigest don't verify package digest(s)
--nosignature don't verify package signature(s)
--rcfile=<FILE:...> read <FILE:...> instead of default file(s)
-r, --root=ROOT use ROOT as top level directory (default: "/")
--querytags 질의 태그를 보여줍니다
--showrc 현재 설정되어 있는 rpmrc의 내용과 매크로를 보여줍니다
--quiet 자세한 출력을 제공합니다
-v, --verbose 아주 상세한 출력을 제공합니다
--version 현재 사용되고 있는 rpm 버전을 표시합니다


Options implemented via popt alias/exec:
--scripts list install/erase scriptlets from package(s)
--setperms set permissions of files in a package
--setugids set user/group ownership of files in a package
--conflicts list capabilities this package conflicts with
--obsoletes list other packages removed by installing this package
--provides list capabilities that this package provides
--requires list capabilities required by package(s)
--info list descriptive information from package(s)
--changelog list change logs for this package
--triggers list trigger scriptlets from package(s)
--last list package(s) by install time, most recent first
--filesbypkg list all files from each package
--fileclass list file names with classes
--filecolor list file names with colors
--fileprovide list file names with provides
--filerequire list file names with requires
--redhatprovides find package name that contains a provided
capability (needs rpmdb-redhat package installed)
--redhatrequires find package name that contains a required
capability (needs rpmdb-redhat package installed)
--buildpolicy=<policy> set buildroot <policy> (e.g. compress man pages)
--with=<option> enable configure <option> for build
--without=<option> disable configure <option> for build


Help options:
-?, --help Show this help message
--usage Display brief usage message

[출처] rpm 사용 옵션|작성자 해안선

--------------------------------------------------

 

posted by cozyboy
: