ºìÁªLinuxÃÅ»§
Linux°ïÖú

һЩ±È½ÏÉúƧµÄ RPM ÃüÁî

·¢²¼Ê±¼ä:2006-03-21 00:24:54À´Ô´:ºìÁª×÷Õß:[Hl.y]
--percent
ʹÓòο¼:
rpm -i --percent nmap-3.00-4.i386.rpm
ÓÃ;:
½«ÏÔʾ°²×°µÄ°Ù·Ö±È

-h or --hash
ʹÓòο¼:
rpm -i --hash nmap-3.00-4.i386.rpm
ÓÃ;:
ÔÚ´óÎļþ°²×°±È½ÏÓѺÃ,Äã¿ÉÒÔ²»Óû³ÒÉÊÇ·ñ»úÆ÷³ö벡ÁË,¿ÉÖªµÀ¾ßÌå×öµ½ÄÄÀï.

-vv [for -i option]
ʹÓòο¼:
rpm -i -vv nmap-3.00-4.i386.rpm
ÓÃ;:
¿ÉÒÔÔÚ°²×°µÄ¹ý³Ì»ñµÃ¸ü¶àµÄÐÅÏ¢


--excludedocs
ʹÓòο¼:
rpm -i --excludedocs nmap-3.00-4.i386.rpm
ÓÃ;:
½«²»°²×°DOCÎĵµ, Ò²¾ÍÊÇ˵ÄãÔÚ/usr/share/doc/Ä¿ÏÂϽ«Ã»ÓÐ nmap-3.00µÄÎĵµÄ¿Â¼. ÕâÔÚÐèÒª½ï½ï¼Æ½Ï°²×°°üËùÐèÒªµÄ¿Õ¼ä±È½ÏÓÐÓÃ,±ÈÈç˵ÄãÔÚ×ö·ÓÉÆ÷?

--includedocs
ʹÓòο¼:
rpm -i --includedocs nmap-3.00-4.i386.rpm
ÓÃ;:
Ö¸¶¨±ØÐè°²×°Ëæ°ü·¢Ë͵ÄÎĵµ

--replacepkgs
ʹÓòο¼:
rpm -i --replacepkgs nmap-3.00-4.i386.rpm
ÓÃ;:
¼´Ê¹¸Ã°üÒѾ­°²×°ÁË,»¹ÊÇÇ¿ÖÆÔٴΰ²×°Ò»±é .

--replacefiles
ʹÓòο¼:
rpm -i --replacefiles nmap-3.00-4.i386.rpm
ÓÃ;:
¼´Ê¹¸Ã°ü»á¸²¸ÇһЩ±ðµÄ°üµÄÎļþ,Ò²¼ÌÐø°²×°

--force
ʹÓòο¼:
rpm -i --force nmap-3.00-4.i386.rpm
ÓÃ;:
ºöÂÔ°üºÍÎļþµÄ³åÍ»,Ç¿ÖÆ°²×°

--noscripts

ʹÓòο¼:
rpm -i --noscripts vsftpd
ÓÃ;:
²»Ö´ÐÐvsftpd.spec ÎļþÄÚµÄ %pre ºÍ % post½Å±¾
ÀýÈç: [%pre]
%prep
%setup -q -n %{name}-%{version}
%patch1 -p1 -b .rh
%patch2 -p1 -b .mok
cp %{SOURCE1} .

ÀýÈç : [%post]
%post
/sbin/chkconfig --add vsftpd
/usr/sbin/usermod -d /var/ftp ftp >/dev/null 2>&1 || :



--prefix
ʹÓòο¼:
rpm -i --prefix /tmp/local nmap-3.00-4.i386.rpm
ÓÃ;:
ʹ¸Ã°ü²»°²×°µ½Ä¬ÈÏĿ¼,¶øÊÇ°²×°µ½ÄãÖ¸¶¨µÄĿ¼

--ftpproxy
ʹÓòο¼:
rpm -i --ftpproxy ftp://ftp.gnomovision.com/pub/rpms/...-1.0-1.i386.rpm

ÓÃ;:
µ±ÄãÐèҪͨ¹ýINTERNET µÄFTPÖ±½Ó°²×°¸Ã°üµÄʱºò,¹«Ë¾µÄ¾ÖÓòÍøÓÐÏÞÖÆ,ÐèÒªÓÃFTP´úÀí²ÅÄÜ·ÃÎÊFTP,ÄÇô¾ÍÓ¦¸ÃʹÓøòÎÊý

--ftpport
ʹÓòο¼:
rpm -i --ftpport ftp://ftp.gnomovision.com/pub/rpms/...-1.0-1.i386.rpm
ÓÃ;:
µ±ÄãÐèÒªÖ¸¶¨Ìض¨µÄ¶Ë¿ÚºÅʱÐèҪʹÓÃ


ÈçºÎ²éѯRed Hat ÌṩµÄ°üÐÅÏ¢?
ÏÈ°²×°Ò»¸öRPM °ü:
rpm -ivh rpmdb-redhat-version.i386.rpm

Õâ¸ö°üÊÇredhatµÄϵͳÉú²úʱ¸½´øµÄrpm°ü. Äã¿ÉÒÔͨ¹ýÕâ¸öÊý¾Ý°üÀ´²é¿´Ä³¸öÌض¨µÄÎļþÊÇÓÉÄĸö°üÀ´ÌṩµÄ,ÕâÑù¿ÉÒÔ½â¾öһЩ°üÒÐÀµµÄÎÊÌâ.

¾ÙÀý˵, µ±Ä㰲װij¸ö°üʱ,³ö´í,˵ȱÉÙÁËlibX11.so.6, ¶øÄã²»ÖªµÀÄĸö°üÌṩÕâ¸öÎļþµÄ,ÄÇô¿ÉÕâÑù×ö:
rpm --redhatprovides libX11.so.6


--oldpackage
ʹÓòο¼:
rpm -U --oldpackage packagename-oldversion.rpm
ÓÃ;:
°²×°ÁËÒ»¸ö°üµÄ¸ü¸ß°æ±¾,È»ºó·¢Ïָð汾ÓÐÎÊÌâ? Äã¸üÔ¸Òâ»Øµ½µÍµÄ°æ±¾? ûÎÊÌâ,¿ÉÒÔ"Éý¼¶"µ½µÍµÄ°æ±¾.

ÔÚRPMÖвéѯ¸ü¶àµÄÓÎÓ¾ÐÅÏ¢? ÄÇôӦ¸Ã³ä·ÖÍÚ¾ò¸ü¶àµÄ²ÎÊý. IT£§s very powerfull!

--whatprovides
ʹÓòο¼:
rpm -q --whatprovides /etc/httpd
ÓÃ;:
²éѯϵͳÖÐij¸öÎļþ,ij¸öĿ¼,ij¸öÄ£¿éÊÇÓÉÄĸö°üÌṩµÄ.

--whatrequires
ʹÓòο¼:
rpm -q --whatrequires module-info

ÓÃ;:
²éѯϵͳÖÐij¸öÎļþ,ij¸öĿ¼,ij¸öÄ£¿éÊÇÄĸö°üÐèÒªµÄ

-g
ʹÓòο¼:
rpm -qg Base
ÓÃ;:
²éѯÊôÓÚij¸ö×éµÄ°ü

-d
ʹÓòο¼:
rpm -qdcf /sbin/dump
ÓÃ;:
²éѯij¸öÃüÁîËùÊôµÄ°üÖÐÏà¹ØÁªµÄËùÓÐÒѾ­±»°²×°µ½ÏµÍ³µÄÎĵµ, Èç¹ûÄãÅöµ½Ä³¸öÃüÁî²»ÖªµÀÊÇʲô¶«Î÷,ÏëÕÒËüµÄ²Î¿¼Îĵµ,ÄÇôÕâ¸öÃüÁî±È½ÏÓÐÓÃ

--dump
ʹÓòο¼:
rpm -ql --dump sendmail
ÓÃ;:
ÏëÖªµÀÕâ¸ö°ü°²×°ÍêµÄËùÓÐÇé¿ö? °üÀ¨ËùÓеÄÎļþ´óС?Ŀ¼λÖÃ?ËùÓÐÎļþ×îºó±»Ð޸ĵÄʱ¼ä?ËùÓÐÎļþµÄowner? group?....¿ÉÒÔÓÃÕâ¸ö²ÎÊý.

--scripts
ʹÓòο¼:
rpm -q --scripts XFree86
ÓÃ;:
Ïë¿´¿´RPM°²×°Ä³¸ö°üÇ°ÐèÒª×öʲô? °²×°Íê×öʲô? ÓÃÕâ¸ö²ÎÊý


ijЩÌرðµÄÀý×Ó.¹ØÓÚ²éѯ

-qcf
ʹÓòο¼:
rpm -qcf /bin/bash
ÓÃ;:
ÓÃÓÚ»ñµÃij¸ö°üµÄÅäÖÃÎļþ¼°Æä¾ßÌåλÖÃ

-qpil
ʹÓòο¼:
rpm -qpil nmap-3.00-4.i386.rpm
ÓÃ;:
²é¿´Ä³¸öδ°²×°µÄRPM°üµÄÐÅÏ¢
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ