´ÓÒ»°ãÒâÒåÉÏ˵£¬Èí¼þ°üµÄ°²×°ÆäʵÊÇÎļþµÄ¿½±´£¬RPM°²×°Èí¼þ°ü£¬Ò²ÎÞÍâºõ´Ë¡£µ«RPMÒª¸ü½øÒ»²½¡¢¸ü´ÏÃ÷һЩ¾ÍÐèÒª¶à×öЩ¹¤×÷ÁË¡£
´ÏÃ÷µÄ°²×°
´ÓÒ»°ãÒâÒåÉÏ˵£¬Èí¼þ°üµÄ°²×°ÆäʵÊÇÎļþµÄ¿½±´£¬¼´°ÑÈí¼þËùÓõĸ÷¸öÎļþ¿½±´µ½Ìض¨Ä¿Â¼¡£RPM°²×°Èí¼þ°ü£¬ÎÞÍâºõ´Ë¡£µ«RPMÒª¸ü½øÒ»²½£¬¸ü´ÏÃ÷һЩ¡£ÔÚ°²×°Ç°£¬Ëüͨ³£ÒªÖ´ÐÐÒÔϲÙ×÷£º
1.¼ì²éÈí¼þ°üµÄÒÀÀµ£¨Dependency£©
RPM¸ñʽµÄÈí¼þ°üÖпɰüº¬ÓÐÒÀÀµ¹ØϵµÄÃèÊö£¬ÈçÈí¼þÖ´ÐÐʱÐèҪʲô¶¯Ì¬Á´½Ó¿â£¬ÐèҪʲô³ÌÐò´æÔÚ¼°°æ±¾ºÅÒªÇóµÈ¡£µ±RPM¼ì²éʱ·¢ÏÖËùÒÀÀµµÄÁ´½Ó¿â»ò³ÌÐòµÈ²»´æÔÚ»ò²»·ûºÏÒªÇóʱ£¬Ä¬ÈϵÄ×ö·¨ÊÇÖÐÖ¹Èí¼þ°ü°²×°¡£
2.¼ì²éÈí¼þ°üµÄ³åÍ»£¨Conflicts£©
ÓеÄÈí¼þÓëijЩÈí¼þ²»Äܹ²´æ£¬Èí¼þ°üÖÆ×÷Õ߻ὫÕâÖÖ³åÍ»¼Ç¼µ½RPMÈí¼þ°üÖС£°²×°Ê±£¬ÈôRPM·¢ÏÖÓгåÍ»´æÔÚ£¬½«»áÖÐÖ¹°²×°¡£
3.Ö´Ðа²×°Ç°½Å±¾³ÌÐò£¨Preinstall£©
´ËÀà³ÌÐòÓÉÈí¼þ°üÖÆ×÷ÕßÉ趨£¬ÐèÒªÔÚ°²×°Ç°Ö´ÐС£Í¨³£ÊǼì²â²Ù×÷»·¾³£¬½¨Á¢ÓйØĿ¼£¬ÇåÀí¶àÓàÎļþµÈµÈ£¬ÎªË³Àû°²×°×÷×¼±¸¡£
4.´¦ÀíÅäÖÃÎļþ£¨Configfiles£©
RPM¶ÔÅäÖÃÎļþ£¨Configfiles£©ÓÐ×ÅÌرðµÄ´¦Àí¡£ÒòΪÓû§³£³£ÐèÒª¸ù¾Ýʵ¼ÊÇé¿ö£¬¶ÔÈí¼þµÄÅäÖÃÎļþ×öÏàÓ¦µÄÐ޸ġ£Èç¹û°²×°Ê±¼òµ¥µØ¸²¸ÇÁË´ËÀàÎļþ£¬ÔòÓû§ÓÖµÃÖØÐÂÊÖ¹¤ÉèÖ㬺ÜÂé·³¡£ÕâÖÖÇé¿öÏ£¬RPM×öµÃ±È½ÏÃ÷ÖÇ£ºËü½«ÔÅäÖÃÎļþ»»¸öÃû×Ö±£´æÁËÆðÀ´£¨ÔÎļþÃûºó׺¼ÓÉÏ.rpmorig£©£¬Óû§¿É¸ù¾ÝÐèÒªÔÙ»Ö¸´£¬±ÜÃâÖØÐÂÉèÖõÄÞÏÞΡ£
5.½âѹÈí¼þ°ü²¢´æ·Åµ½ÏàӦλÖÃ
ÕâÊÇ×îÖØÒªµÄ²¿·Ö£¬Ò²ÊÇÈí¼þ°ü°²×°µÄ¹Ø¼üËùÔÚ¡£ÔÚÕâÒ»²½£¬RPM½«Èí¼þ°ü½âѹËõ£¬½«ÆäÖеÄÎļþÒ»¸ö¸ö´æ·Åµ½ÕýÈ·µÄλÖã¬Í¬Ê±£¬ÎļþµÄ²Ù×÷ȨÏÞµÈÊôÐÔÏàÓ¦ÉèÖÃÕýÈ·¡£
6.Ö´Ðа²×°ºó½Å±¾³ÌÐò£¨Postinstall£©
´ËÀà³ÌÐòΪÈí¼þµÄÕýÈ·Ö´ÐÐÉ趨Ïà¹Ø×ÊÔ´£¬ÈçÐÞ¸Äinetd.conf¡¢ÔËÐÐldconfig³ÌÐòÒÔÀûеĶ¯Ì¬Á´½Ó¿âÉúЧµÈµÈ¡£
7.¸üÐÂRPMÊý¾Ý¿â
°²×°ºó£¬RPM½«Ëù°²×°µÄÈí¼þ¼°Ïà¹ØÐÅÏ¢¼Ç¼µ½ÆäÊý¾Ý¿âÖУ¬±ãÓÚÒÔºóÉý¼¶¡¢²éѯ¡¢Ð£ÑéºÍжÔØ¡£
8.Ö´Ðа²×°Ê±´¥·¢½Å±¾³ÌÐò£¨Triggerin£©
´¥·¢½Å±¾³ÌÐòÊÇÖ¸Èí¼þ°üÂú×ãijÖÖÌõ¼þ£¨ÈçÒÑ°²×°Èí¼þ°üsendmail£¬»òfile°æ±¾´óÓÚ3.0£©Ê±²Å´¥·¢Ö´ÐеĽű¾³ÌÐò£¬ËüÓÃÓÚÈí¼þ°üÖ®¼äµÄ½»»¥¿ØÖÆ¡£´¥·¢½Å±¾³ÌÐòÓÐÈýÀࣺһÊÇÈí¼þ°ü°²×°Ê±²Å´¥·¢µÄ£¬³ÆΪ°²×°Ê±´¥·¢½Å±¾³ÌÐò£¨triggerin£©£»¶þÊÇÈí¼þ°üжÔØÇ°´¥·¢µÄ£¬½Ð×÷жÔØÇ°´¥·¢½Å±¾³ÌÐò£¨triggerun£©£»ÈýÊÇÈí¼þ°üжÔغó²Å´¥·¢Ö´Ðеģ¬³Æ×÷жÔغ󴥷¢½Å±¾³ÌÐò£¨triggerpostun£©¡£ÕâЩ´¥·¢½Å±¾³ÌÐò£¬´ó´óÀ©Õ¹ÁËRPMÈí¼þ°ü¹ÜÀíµÄ¹¦ÄÜ¡£
ÃüÁî¸ñʽ
°²×°RPM¸ñʽµÄÈí¼þ°ü£¬¿ÉʹÓÃÈçÏÂÃüÁî¸ñʽ£º
rpm -i [°²×°Ñ¡Ïî1 °²×°Ñ¡Ïî2...] °ü¹üÎļþ1 °ü¹üÎļþ2...
×¢£º¿ÉÓÃ--install´úÌæ-i£¬Ð§¹ûÏàͬ¡£
Ñ¡ÏîÁбí
°ü¹üÎļþ
¶ÔÓÚÒª°²×°µÄRPM¸ñʽµÄ°ü¹üÎļþ£¬RPM¶ÔÆäÃû×Ö²»×÷Ç¿ÖÆÒªÇó¡£Óû§¿ÉÒÔʹÓÃÒÔÏÂÈýÖÖ·½Ê½µÄÃüÃûÑùʽ£º
1.µäÐ͵ÄÃüÃûÑùʽ£¨³£Óã©£º
¸ñʽΪ£ºÈí¼þÃû-°æ±¾ºÅ-ÊͳöºÅ.ÌåϵºÅ.rpm
×¢£ºÌåϵºÅÖ¸µÄÊÇÖ´ÐгÌÐòÊÊÓõĴ¦ÀíÆ÷Ìåϵ£¬Èçi386Ìåϵ£¬sparcÌåϵµÈ¡£ÌåϵºÅΪsrcʱ±íÃ÷ΪԴ´úÂë°ü£¬·ñÔòΪִÐгÌÐò°ü¡£
Èçabc-3.2-1.i386.rpmΪִÐгÌÐò°ü£¬Èí¼þÃûΪabc£¬°æ±¾ºÅΪ3.2£¬ÊͳöºÅΪ1£¬ÊÊÓÃÌåϵΪi386£¬¶øabc-3.2-1.src.rpmÔòΪԴ´úÂë°ü¡£
2.URLÐÎʽµÄÃüÃûÑùʽ£¨½Ï³£Óã©£º
* FTP·½Ê½µÄÃüÃû¸ñʽ£ºftp://[Óû§Ãû[:ÃÜÂë]@]Ö÷»ú[:¶Ë¿Ú]/°ü¹üÎļþ
×¢£º[]À¨×¡µÄÄÚÈݱíʾ¿ÉÑ¡¡£Ö÷»ú¿ÉÒÔÊÇÖ÷»úÃû£¬Ò²¿ÉÊÇIPµØÖ·¡£°ü¹üÎļþ¿Éº¬Ä¿Â¼ÐÅÏ¢¡£Èçδָ¶¨Óû§Ãû£¬ÔòRPM²ÉÓÃÄäÃû·½Ê½´«ÊäÊý¾Ý£¨Óû§ÃûΪ anonymous£©¡£Èçδָ¶¨ÃÜÂ룬ÔòRPM»á¸ù¾Ýʵ¼ÊÇé¿öÌáʾÓû§ÊäÈëÃÜÂë¡£Èçδָ¶¨¶Ë¿Ú£¬ÔòRPMʹÓÃĬÈ϶˿ڣ¨Ò»°ãΪ21£©¡£
Èçftp://ftp.xxx.com/yyy.rpm£¨Ê¹ÓÃÄäÃû´«Ê䣬Ö÷»úftp.xxx.com£¬°ü¹üÎļþyyy.rpm£©£»
Èçftp://24.109.164.55:1024/pub/yyy.rpm£¨ÄäÃûFTP´«Ê䣬Ö÷»úIP:24.109.164.55£¬Ê¹ÓÃ1024¶Ë¿Ú£¬°ü¹üÎļþÔÚ/pubĿ¼Ï£©£»
Èçftp://zhsoft@ftp.xxx.com/yyy.rpm£¨Ö÷»úftp.xxx.com£¬FTPÓû§Ãûzhsoft£¬ÈçÓÐÃÜÂ룬RPM½«»á×Ô¶¯ÌáʾÊäÈ룩£»
Èçftp://zhsoft:password@ftp.xxx.com/yyy.rpm£¨Ö÷»úftp.xxx.com£¬FTPÓû§Ãûzhsoft£¬ÃÜÂëpassword£©¡£
* HTTP·½Ê½µÄÃüÃû£ºhttp://Ö÷»ú[:¶Ë¿Ú]/°ü¹üÎļþ
×¢£º[]À¨×¡µÄÄÚÈÝ¿ÉÑ¡¡£Ö÷»ú¿ÉÒÔÊÇÖ÷»úÃû£¬Ò²¿ÉÊÇIPµØÖ·¡£°ü¹üÎļþ¿Éº¬Ä¿Â¼ÐÅÏ¢¡£Èçδָ¶¨¶Ë¿Ú£¬ÔòRPMĬÈÏʹÓÃ80¶Ë¿Ú¡£
Èçhttp://www.xxx.com/yyy.rpm£¨ÓÃHTTP»ñÈ¡www.xxx.comÖ÷»úÉϵÄyyy.rpmÎļþ£©£»
ÓÖÈçhttp://www.xxx.com:8080/pub/yyy.rpm£¨ÓÃHTTP»ñÈ¡www.xxx.comÖ÷»úÉÏ/pubĿ¼ÏµÄyyy.rpmÎļþ£¬Ê¹Óö˿Ú8080£©¡£
3.ÆäËüÐÎʽ£¨ºÜÉÙʹÓã©£º
ÃüÃû¸ñʽ£ºÈÎÒâ
È罫abc-3.2-1.i386.rpm¸ÄÃûΪabc.txt£¬ÓÃRPM°²×°Ò²»á°²×°³É¹¦£¬Æä¸ù±¾ÔÒòÊÇRPMÅж¨Ò»¸öÎļþÊÇ·ñRPM¸ñʽ£¬²»ÊÇ¿´Ãû×Ö£¬¶øÊÇ¿´ÄÚÈÝ£¬¿´ÆäÊÇ·ñ·ûºÏÌض¨µÄ¸ñʽ¡£
Ñ¡ÏîÏê½â
Ò»¡¢°²×°Ö¸¶¨ÓÃÑ¡Ïî
1.hash£¨»ò-h£©£ºÒÔ#ÏÔʾ°²×°½ø¶È
Èç¹ûÒ»¸öÈí¼þ°üºÜ´ó¡¢°²×°·Ñʱʱ£¬Óû§ÈôÏ뼰ʱÁ˽ⰲװ½ø¶È£¬±ØÐëÓôËÑ¡Ïî¡£¸ÃÑ¡ÏîÒÔÏÔʾ#ºÅ±íʾ½ø¶È£¬Ã¿¸ö#ºÅ±íʾ2%µÄ½ø¶È£¬×ܹ²ÒªÏÔʾ50¸ö#ºÅ¡£ÏÂÃæ°²×°MySQLÈí¼þ°ü£¬ÈçÏÂËùʾ£º
# rpm -i --hash MySQL-3.22.32-1.i386.rpm
##################################################
#
´ÓÉÏ¿´³ö£¬Èí¼þ°ü°²×°Ë³ÀûÍê³É¡£
2.percent£ºÒÔ%£¨°Ù·Ö±È£©ÏÔʾ°²×°½ø¶È
percentµÄº¬ÒåÊǰٷֱȣ¬¶ø´ËÑ¡ÏîµÄ×÷ÓþÍÊÇÒ԰ٷֱȣ¨%£©À´ÏÔʾ°²×°½ø¶ÈµÄ¡£Í¬ÑùÊÇ°²×°MySQLÈí¼þ°ü£¬ÏÂÃæµÄÊä³ö¾Í²»Ò»Ñù£º
# rpm -i --percent MySQL-3.22.32-1.i386.rpm
%% 0.000000
%% 0.002600
%% 0.020586
......
%% 100.000000
#
ÉÏÀýÖÐÊ¡ÂÔÁ˺ܶàÊä³ö£¨......±íʾ£©¡£ÒòΪÈç¹ûÈí¼þ°üºÜ´ó£¬ÔòÓÃ--percentʱÊä³öµÄÄÚÈÝ»áºÜ¶à£¬ËùÒÔÓû§×îºÃÓÃ--hashÑ¡ÏÒÔ#ºÅÀ´±íʾ°²×°½ø¶È£¬ÕâÑù¼ò½àÃ÷ÁË¡£
3.test£º°²×°²âÊÔ
Ëùν°²×°²âÊÔ£¬Òâ¼´²¢·ÇÕæÕýµÄ°²×°£¬Ëü²»¿½±´ºÍ½¨Á¢ÈκÎÎļþ¡£Ê¹Óñ¾Ñ¡ÏîµÄÄ¿µÄÔÚÓÚ£º¼ì²âÈí¼þ°üµÄÒÀÀµ¹ØϵÊÇ·ñÂú×㣬ÊÇ·ñ´æÔÚDZÔڵijåÍ»µÈµÈ¡£
# rpm -i --test autofs-3.1.3-2.i386.rpm
error: failed dependencies:
mktemp is needed by autofs-3.1.3-2
#
±¾Àý½øÐа²×°²âÊÔʱ·¢ÏÖÁËÒÀÀµ·½ÃæµÄ´íÎó£¬autofsËùÐèÒªµÄmktemp°ü²»´æÔÚ£¬°²×°Öжϡ£
ÏÂÃæÏÈ°²×°mktempÈí¼þ°ü£¬ÔÙ½øÐÐautofs°²×°²âÊÔ£¬¿´Çé¿öÔõôÑù£º
# rpm -i mktemp-1.5-2.i386.rpm
# rpm -i --test autofs-3.1.3-2.i386.rpm
#
ÓÉÉÏ¿´³ö£¬Õâ´Î²âÊÔûÓгöÏÖʲô´íÎó¡£
4.replacepkgs£ºÌæ»»Èí¼þ°ü
ΪʲôҪÌæ»»Èí¼þ°ü£¿ÔÒò¿ÉÄÜÊÇϵͳÖеÄÈí¼þ°üÒѾÆÆ»µÁË£¬ÆäÖÐÒ»¸ö»ò¶à¸öÎļþ¶ªÊ§»òËð»Ù¡£Èç¹ûÓû§ÏëÐÞ¸´Õâ¸öÈí¼þ°ü£¬ÓÃÖ±½Ó°²×°µÄ·½·¨£¬RPM½«±¨´íÍ˳ö£º
# rpm -V file
missing/usr/man/man1/file.1
# rpm -i file-3.26-6.i386.rpm
package file-3.26-6 is already installed
#
×¢£º±¾ÀýÏÈÓÃRPMУÑéÃüÁîУÑéÒ»ÏÂfileÈí¼þ°ü£¬·¢ÏÖ/usr/man/man1/file.1Îļþ¶ªÊ§¡£Ö®ºóÓð²×°ÃüÁî°²×°£¬RPMÌáʾÈí¼þ°ü file-3.26-6ÒѾ°²×°ÁË¡££¨ÓйØRPMУÑéÃüÁ<<¾«Í¨RPMÖ®Áù--УÑéƪ>>Öн«»áÓÐÏêϸµÄ½éÉÜ£©
Èç¹û²ÉÓÃ--replacepkgsÑ¡Ï½á¹ûÓÖÔõÑùÄØ£¿
# rpm -i --replacepkgs file-3.26-6.i386.rpm
# rpm -V file
#
¿´À´£¬RPM³É¹¦µØÌæ»»ÁËÔÈí¼þ°ü£¬Ð£Ñéһϸðü£¬·¢ÏÖûÓдíÎóÊä³ö£¬ËùÒÔÏÖÔÚµÄÈí¼þ°üÊÇÍêÕûµÄ¡£
5.replacefiles£ºÌæ»»Îļþ
RPMÊÇ´ÏÃ÷µÄÈí¼þ°ü¹ÜÀíÆ÷£¬Ëüά»¤×Åÿ¸öÒÑ°²×°Èí¼þ°üµÄÎļþÐÅÏ¢¡£Èç¹ûÔÚ°²×°Ò»¸öеÄÈí¼þ°üʱ£¬RPM·¢ÏÖÆäÖÐij¸öÎļþºÍÒÑ°²×°µÄij¸öÈí¼þ°üÖеÄÎļþÃû×ÖÏàͬµ«ÄÚÈݲ»Í¬£¬ÄÇôRPM¾Í»áÈÏΪÕâÊÇÒ»¸öÎļþ³åÍ»£¬»á±¨´íÍ˳ö£º
# rpm -i ff-4.0-2.i386.rpm
file /root/my.a from install of ff-4.0-2 conflicts with file from package zoo-6.0-1
#
×¢£º±¾ÀýÖÐRPM·¢ÏÖÒª°²×°µÄÈí¼þ°üff-4.0-2ÓëÒÑ°²×°µÄÈí¼þ°üzoo-6.0-1ÖУ¬º¬ÓÐÏàͬµÄÒ»¸öÎļþ/root/my.a£¬µ«ÆäÄÚÈݲ¢²»Ïàͬ£¬ËùÒÔÌáʾÁËÎļþ³åÍ»µÄ´íÎó¡£
Èç¹ûÓû§ÏëºöÂÔÕâ¸ö´íÎ󣬿ÉʹÓÃ--replacefilesÑ¡ÏָʾRPM·¢ÏÖÎļþ³åͻʱ£¬Ö±½ÓÌæ»»µôÔÎļþ¼´¿É¡£×¢Ò⣺³ý·ÇÓû§¶ÔËù³åÍ»µÄÎļþÓкÜÉîµÄÁ˽⣬²»ÒªÇáÒ×Ìæ»»Îļþ£¬ÒÔÃâÆÆ»µÒÑ°²×°Èí¼þ°üµÄÍêÕûÐÔ£¬È·±£ÆäÄÜÕý³£ÔËÐС£
# rpm -i --replacefiles ff-4.0-2.i386.rpm
#
²ÉÓøÃÑ¡Ïîºó£¬Èí¼þ°üÄÜ˳Àû°²×°ÁË¡£
ÁíÍ⣬˵µ½Ìæ»»Îļþ£¬ÈôÒª°²×°µÄÈí¼þ°üÖеÄÎļþÒÑ´æÔÚ£¬µ«´ËÎļþ²¢²»ÊôÓÚÈκÎÈí¼þ°ü£¬RPMµÄ×ö·¨Êǽ«Îļþ»»Ãû±£´æ£¨ÎļþÃûºó׺¼Ó.rpmorig£©£¬²¢ÇÒÒÔ¾¯¸æÐÅÏ¢ÌáÐÑÓû§¡£ÈçÏÂËùʾ£º
# rpm -i foo-6.0-1.i386.rpm
warning: /etc/foo.conf saved as /etc/foo.conf.rpmorig
#
6.allfiles£º°²×°ËùÓÐÎļþ
¶ÁÕß¿´µ½´ËÑ¡ÏҲÐíÒªÎÊ£ºÄѵÀRPM°²×°Èí¼þ°ü²»ÊÇ°²×°ÆäÖÐËùÓеÄÎļþÂð£¿
ÎҵĻشðÊÇ£ºÈç¹ûÊdzõ´Î°²×°µÄ»°£¬RPMÈ·Êǽ«°üÖÐËùÓÐÎļþÈ«²¿°²×°¡£µ«ÊÇ£¬Èç¹ûÊÇÐÞ¸´Èí¼þ°ü£¨ÓÃ--replacepkgsÑ¡Ï£¬Äǽá¹û¾Í²»Ò»¶¨ÁË¡£¸öÖÐÔÒòÊÇ£ºRPM°üÖÐÓÐЩÅäÖÃÎļþ¿É±êʶΪmissingokÊôÐÔ£¨missingokÖ¸µÄÊǼ´Ê¹¶ªÊ§£¬ÕÕÑùOK£©£¬ÕâÑùµÄ°ü°²×°ºó£¬ÈôÕâÖÖÀàÐ͵ÄÅäÖÃÎļþ±»É¾³ý£¬ÔòÐÞ¸´Ê±RPMĬÈϵÄ×ö·¨ÊDz»ÔÙ°²×°ÕâÖÖÀàÐ͵ÄÎļþ£¬³ý·Ç²ÉÓÃ--allfilesÑ¡Ïî¡£ÏÂÃæ¿´¸öʵ¼ÊµÄÀý×Ó£º
# rpm -i foo-6.0-1.i386.rpm
# ls -l /etc/foo.conf
-rw-r--r-- 1 root root9 Oct 11 09:50 /etc/foo.conf
# rm -f /etc/foo.conf
# rpm -i --replacepkgs foo-6.0-1.i386.rpm
# ls -l /etc/foo.conf
ls: /etc/foo.conf: Îļþ»òĿ¼²»´æÔÚ
# rpm -i --replacepkgs --allfiles foo-6.0-1.i386.rpm
# ls -l /etc/foo.conf
-rw-r--r-- 1 root root9 Oct 11 09:50 /etc/foo.conf
×¢£º±¾ÀýÖÐÒÑÔ¤ÏÈÖªµÀfoo°üÖеÄÅäÖÃÎļþ/etc/foo.conf´øÓÐmissingokÊôÐÔ¡£
£¨1£©ÓÃrpm -iÃüÁî°²×°foo°ü£»
£¨2£©ÓÃlsÃüÁîÁÐÒ»ÏÂÊôÓڸðüµÄÅäÖÃÎļþ/etc/foo.conf£¨ÄÜÁгöÀ´£¬±íÃ÷Îļþ´æÔÚ£©£»
£¨3£©ÓÃrmÃüÁîɾ³ýÁËÕâ¸öÎļþ£»
£¨4£©ÓÃrpm -i --replacepkgsÃüÁîÐÞ¸´fooÈí¼þ°ü£»
£¨5£©ÒòΪÐÞ¸´Ê±Î´ÓÃ--allfilesÑ¡ÏËùÒÔÓÃlsÃüÁîÁÐÎļþ/etc/foo.confʱ³ö´íÁË£ºÎļþ²»´æÔÚ£¬Ã»Óа²×°ÉÏ£»
£¨6£©ÓÃrpm -i --replacepkgs --allfilesÃüÁî°²×°ÐÞ¸´fooÈí¼þ°ü£»
£¨7£©ÔÙ¶ÈÓÃlsÃüÁîÁÐÎļþ£¬ÁÐÁ˳öÀ´£¬±íÃ÷Õâ´Î°²×°ÉÏÁË¡£
Óɱ¾Àý¿´³ö£¬ÈôÓû§È·ÊµÏ밲ȫ»Ö¸´£¨ÐÞ¸´£©Ä³¸öÈí¼þ°ü£¬×îºÃʹÓÃ--allfilesÑ¡Ïî¡£Ò»°ãÇé¿öÏÂÔò²»±ØÕâô×ö£¬ÒòΪ´øÓÐmissingokÊôÐÔµÄÅäÖÃÎļþ±¾À´¾ÍÊÇ¿ÉÒÔ¶ªÊ§µÄÂ²»±ØÌ«ÔÚÒâÁË¡£
7.force£ºÇ¿ÖÆÖ´ÐÐ
forceµÄº¬ÒåÊÇÇ¿ÖÆ¡£--forceÑ¡ÏîµÄ×÷ÓþÍÊÇÇ¿ÖÆ°²×°Èí¼þ°ü£¬²»¿¼ÂÇÈí¼þ°üÊÇ·ñÒÑ°²×°£¬Ò²²»¿¼ÂÇÓÐûÓÐÎļþ³åÍ»¡£ÆäЧ¹ûÏ൱ÓÚͬʱѡÓÃ--replacepkgsÓë--replacefilesÑ¡Ïî½øÐа²×°¡£
8.excludedocs£º²»°²×°ËµÃ÷Îĵµ
RPMÓжà¸öºÃ¹¦ÄÜ£¬ÆäÖÐÖ®Ò»¾ÍÊÇ£ºËü½«Îļþ·ÖΪÅäÖÃÎļþ£¬ËµÃ÷ÎĵµºÍÆäËüÎļþÈýÖÖ£¬ÕâÑù±ãÓÚÇø±ð¶Ô´ý£¬Áé»î´¦Àí¡£
»ùÓÚRPM°²×°µÄLINUX·¢ÐаæÖаüÀ¨5000¶à¸ö˵Ã÷Îĵµ£¬ÓÐ50M×Ö½Ú£¬Õ¼ÓõĿռ䲻С¡£Èç¹ûÏë½ÚÊ¡¿Õ¼ä£¬¿ÉʹÓÃ--excludedocsÑ¡ÏîÒÔÅųý°²×°ËµÃ÷Îĵµ¡£
ÈçÈí¼þ°üfileÖаüº¬/usr/man/man1/file.1ºÍ/usr/man/man4/magic.4Á½¸ö˵Ã÷Îĵµ¡£°²×°Ê±ÈôʹÓÃ--excludedocsÑ¡ÏÕâÁ½¸öÎĵµ¾Í²»»á±»°²×°¡£
# rpm -i --excludedocs file-3.26-6.i386.rpm
# ls -l /usr/man/man1/file.1
ls: /usr/man/man1/file.1: Îļþ»òĿ¼²»´æÔÚ
# ls -l /usr/man/man4/magic.4
ls: /usr/man/man4/magic.4: Îļþ»òĿ¼²»´æÔÚ
#
Èç¹ûÓû§ÏëÈÃRPMĬÈϲ»°²×°ËµÃ÷Îĵµ£¬Ôò¿ÉÒÔÕâô×ö£º±à¼~/.rpmmacrosÎļþ£¨Óû§Ö÷Ŀ¼HOMEϵÄRPMºêÎļþ£©£¬¼ÓÈëÏÂÃæÒ»ÐУº
%_excludedocs 1
Æä×÷ÓÃÊǶ¨ÒåRPMÄÚ²¿µÄ_excludedocsºêΪ1£¬È·Èϲ»°²×°ËµÃ÷Îĵµ¡£
ÕâÑùµÄ»°£¬¾Í²»ÓÃÔÚÃüÁîÐÐʹÓÃ--excludedocsÑ¡ÏîÁË¡£
# rpm -i file-3.26-6.i386.rpm
# ls -l /usr/man/man1/file.1
ls: /usr/man/man1/file.1: Îļþ»òĿ¼²»´æÔÚ
# ls -l /usr/man/man4/magic.4
ls: /usr/man/man4/magic.4: Îļþ»òĿ¼²»´æÔÚ
#
9.includedocs£º°²×°ËµÃ÷Îĵµ
RPMÒ»°ãÇé¿öÏÂÊÇ°²×°ËµÃ÷ÎĵµµÄ£¬µ«ÊÇÈç¹ûÓû§×ÔÐÐÐÞ¸ÄÁËÉ趨£¨ÏóÉÏÃæµÄÀý×Ó£©£¬ÔòRPM¾Í²»ÔÙ°²×°ËµÃ÷ÎĵµÁË£¬³ý·ÇÌرðÖ¸¶¨£¬Õâ¾ÍÓõ½--includedocsÑ¡Ïî¡£ÕâÖÖÇé¿öÏ£¬Ö»ÓÐÓôËÑ¡Ïî²ÅÄÜÈ·±£°²×°ËµÃ÷Îĵµ¡£
# rpm -i --includedocs file-3.26-6.i386.rpm
# ls -l /usr/man/man1/file.1
-rwxr-xr-x 1 root root12023 Mar 23 1999 /usr/man/man1/file.1
# ls -l /usr/man/man4/magic.4
-rwxr-xr-x 1 root root 6625 Mar 23 1999 /usr/man/man4/magic.4
#
10.noscripts£º²»Ö´Ðнű¾³ÌÐò
Ò»¸öRPMÈí¼þ°üÖпɰüº¬ÎåÖֽű¾³ÌÐò£¬¼´£º°²×°Ç°½Å±¾³ÌÐò£¬°²×°ºó½Å±¾³ÌÐò£¬Ð¶ÔØÇ°½Å±¾³ÌÐò£¬Ð¶Ôغó½Å±¾³ÌÐòºÍУÑé½Å±¾³ÌÐò¡£°²×°Ê±Ê¹ÓÃ--noscriptsÑ¡Ï¿É½ûÖ¹°²×°Ç°Óë°²×°ºó½Å±¾³ÌÐòµÄÖ´ÐС£
# rpm -i foo-6.0-1.i386.rpm
preinstall is running ... done
postinstall is running ... done
#
ÉÏÃæ²»½ûÖ¹½Å±¾³ÌÐòµÄÖ´ÐУ¬ÏÂÃæ²»Ö´Ðнű¾³ÌÐò£¬Çë¿´Êä³ö½á¹û£º
# rpm -i --noscripts foo-6.0-1.i386.rpm
#
¿´£¬ÒòΪûÓа²×°Ç°Óë°²×°ºó½Å±¾³ÌÐòµÄÖ´ÐУ¬ËùÒÔûÓÐʲôÊä³öÁË¡£
×¢Ò⣺һ°ãÓû§²»ÒªÊ¹ÓôËÑ¡Ïî¡£´ËÑ¡ÏîÖ÷ÒªÌṩ¸øÈí¼þ°üÖÆ×÷ÕßʹÓõġ£Í¨¹ý½ûÖ¹Ö´Ðнű¾³ÌÐò£¬¿ÉÒÔ·ÀÖ¹Òò°²×°´øÓÐBUGµÄÈí¼þ°ü¶øå´µôÕû¸öϵͳ¡£µ±Èí¼þ°üÈ¥µôÁËBUGºó£¬´ËÑ¡Ïî¾Í²»±ØʹÓÃÁË¡£
11.nodeps£º²»¼ì²éÒÀÀµ
RPM¹ÜÀíÈí¼þ°ü£¬²»½ö¹ÜÀí°üÖеÄËùÓÐÎļþ£¬»¹Í¬Ê±¹ÜÀí×ÅÈí¼þ°üÖ®¼äµÄÒÀÀµ¹Øϵ¡£ÈçAÒÀÀµÓÚBÔËÐУ¬ÈôB²»´æÔÚÁË£¬ÔòAÒ²¾ÍÔËÐв»ÁËÁË¡£RPMά»¤×ÅÕâÖÖ¹Øϵ£¬¾¡Á¿±ÜÃâÆÆ»µ£¬ÒÔ±£Ö¤Èí¼þµÄÕý³£ÔËÐС£
# rpm -i autofs-3.1.3-2.i386.rpm
error: failed dependencies:
mktemp is needed by autofs-3.1.3-2
#
±¾Àý°²×°ÖгöÏÖÁËÒÀÀµ·½ÃæµÄ´íÎó£¨autofsÒÀÀµmktemp£¬µ«mktemp²»´æÔÚ£©£¬°²×°¹ý³ÌÖжÏÁË¡£Èç¹ûÒªRPM²»¹ÜÒÀÀµ¹ØϵÊÇ·ñÕý³£¶¼°²×°£¬¾ÍÒªÓÃ--nodepsÑ¡ÏָʾRPM²»¼ì²éÒÀÀµ£¬ÕâÑù¾ÍÄÜÕý³£°²×°ÁË¡£
# rpm -i --nodeps autofs-3.1.3-2.i386.rpm
#
×¢£º³ý·ÇÓû§¶ÔÈí¼þ°üÓÐ×ã¹»Á˽⣬»òÖ»Ïë¿´¿´Èí¼þ£¬·ñÔò²»ÒªÊ¹Óñ¾Ñ¡ÏÒÔά»¤Èí¼þ¼äÕý³£µÄÒÀÀµ¹Øϵ¡£
12.notriggers£º²»Ö´Ðд¥·¢³ÌÐò
ΪÁËÈí¼þ°ü¼äµÄ½»»¥¿ØÖÆ£¬RPMÉè¼ÆÁËÈýÖÖ´¥·¢³ÌÐò£º°²×°Ê±´¥·¢³ÌÐò£¬Ð¶ÔØÇ°´¥·¢³ÌÐòºÍжÔغ󴥷¢³ÌÐò¡£ÎªÁË·ÀÖ¹ÒòijһÈí¼þ°üµÄ°²×°¶øÒý·¢°²×°Ê±´¥·¢³ÌÐòµÄÖ´ÐУ¬¿ÉÒÔʹÓÃ--notriggersÑ¡Ïî¡£
13.ignorearch£ººöÂÔÌåϵÓëignoreos £ººöÂÔ²Ù×÷ϵͳ
ºÎνÌåϵ?Ìåϵ¾ÍÊÇCPUµÄÀà±ð£¬ÓÐIntelµÄx86£¨Èçi386£¬i486ϵÁУ©Ìåϵ£¬ÓÐSunµÄsparcÌåϵµÈµÈ¡£µ±Ò»¸öÈí¼þ°ü½¨Á¢Ê±£¬RPM¾ÍΪÆäÖ¸¶¨ÁËËùÊÊÓõÄCPUÌåϵ£¬Ò²ÎªÆäÖ¸¶¨ÁËËùÊÊÓõIJÙ×÷ϵͳ¡£ÕâÑù×öµÄºÃ´¦¾ÍÊÇ£¬RPMÈÝÒ×ÖªµÀΪһ̨¼ÆËã»úËù½¨Á¢µÄÈí¼þ°üÊÇ·ñÊÊÓÃÓÚ¼æÈÝÓÚÁíһ̨¼ÆËã»ú¡£RPMµÄ×ÊÔ´ÅäÖÃÎļþ£¨Ä¬ÈÏΪ/usr/lib/rpm/rpmrc£©ÖУ¬¾Í¶¨ÒåÁËÌåϵµÄ¼æÈݹØϵ£¨arch_compat±í´ï£©ºÍ²Ù×÷ϵͳµÄ¼æÈݹØϵ£¨os_compat±í´ï£©¡£RPM°²×°Ò»¸ö°ü¹üÎļþʱ£¬Òª×öÕâÑùÒ»¸ö¼æÈÝ·½ÃæµÄ¼ì²é¡£Èç¹ûÓû§ÏëºöÂÔÌåϵ£¬²»¹ÜÆäÊÇ·ñ¼æÈÝ£¬ÇëÓÃ-- ignorearchÑ¡Ïî°²×°¡£Èç¹ûÒ²²»¹Ü²Ù×÷ϵͳÊÇ·ñ¼æÈÝ£¬¿ÉÓÃ--ignoreosÑ¡Ïî¡£ÐèÒªÖ¸³öµÄÊÇ£¬Èô·ÇÖªµÀ×Ô¼ºÕâÑùµÄÄ¿µÄ£¬·ñÔò²»ÒªÊÔͼÕâÑù×ö¡£
14.ignoresize£º²»¼ì²é¿Õ¼ä´óС
RPM°²×°Èí¼þ°üÇ°£¬Ê×ÏÈÒª¼ì²éµ±Ç°ÏµÍ³ÊÇ·ñÓÐ×ã¹»µÄÊ£Óà¿Õ¼ä£¬Èç¹û¿Õ¼ä²»×ãµÄ»°£¬°²×°½«ÎÞ·¨Íê³É¡£Ê¹Óñ¾Ñ¡ÏîµÄÄ¿µÄ£¬ÔÚÓÚָʾRPM²»×ö¿Õ¼ä´óС·½ÃæµÄ¼ì²é£¬Òâ¼´²»¹ÜϵͳÊÇ·ñÓÐÈÝÄÉÒª°²×°µÄÈí¼þ°üµÄ¿Õ¼ä£¬ÕÕÖ±°²×°¾ÍÐÐÁË¡£
15.relocate£ºÖض¨Î»
RPMÈí¼þ°üÔÚÖÆ×÷¹ý³ÌÖУ¬¿ÉÒÔ¶¨ÒåÒ»¸ö»ò¶à¸öÖض¨Î»Ç°×º£¬ÒÔ´Ë·½±ãÈí¼þµÄÖض¨Î»£¨¼´°ÑÈí¼þ°üÖеÄÎļþ·Åµ½×Ô¶¨ÒåµÄĿ¼ÏÂÃ棩£¬´Ó¶øÔö¼ÓÈí¼þ°ü°²×°µÄÁé»îÐÔ¡£
±¾Ñ¡ÏîÓÃÓÚ¸ü»»Ö¸¶¨µÄÖض¨Î»Ä¿Â¼£¬Èç¹ûÒ»¸ö°üÓжà¸öÖض¨Î»Ç°×º£¬¿ÉÒÔʹÓñ¾Ñ¡Ïî¶à´Î¡£
# rpm -qpl file-3.26-6.i386.rpm
/usr/bin/file
/usr/man/man1/file.1
/usr/man/man4/magic.4
/usr/share/magic
# rpm -i --relocate /usr=/tmp file-3.26-6.i386.rpm
# rpm -ql file
/tmp/bin/file
/tmp/man/man1/file.1
/tmp/man/man4/magic.4
/tmp/share/magic
#
×¢£º±¾ÀýÖÐÏÈÓÃrpm -qplÁгö°ü¹üÎļþfile-3.26-6.i386.rpmµ±ÖеÄÎļþ£¬¿ÉÒÔ¿´µ½ÆäÖеÄÎļþ¾ùÊÇÒÔ/usr¿ªÍ·µÄ¡£Ö®ºó½øÐÐÖض¨Î»°²×°£¬½«/usr»»×÷/tmp¡£×îºó´ÓÁгöÒÑ°²×°µÄfile°üµÄÎļþÁбí¿ÉÒÔ¿´³ö£¬ÔÀ´µÄ/usrĿ¼ǰ׺»»×÷Ö¸¶¨µÄǰ׺/tmpÁË£¬ÕâÑùʵÏÖÁËÈí¼þµÄÖض¨Î»¡££¨¹ØÓÚRPM ²éѯÃüÁÏê¼û<<¾«Í¨RPMÖ®Îå--²éѯƪ>>£©
16.badreloc£ºÇ¿ÖÆÖض¨Î»
RPMÈí¼þ°üµÄÖض¨Î»£¬ÒÀÀµÓÚÖÆ×÷ʱÖض¨Î»Ç°×ºµÄ¶¨Òå¡£Èç¹ûûÓж¨ÒåÖض¨Î»Ç°×º£¬»òÕßÓû§°²×°Ê±ËùÖ¸¶¨µÄÖض¨Î»Ç°×º²»´æÔÚ£¬ÔòRPM»á±¨´íÍ˳ö£¬Öжϰ²×°¡£´Ëʱ£¬ÈôÓñ¾Ñ¡ÏÔòRPM»á²»¹ÜÕâЩ´íÎ󣬽øÐÐÇ¿ÖƵÄÖض¨Î»°²×°¡£×¢£º±¾Ñ¡ÏîºÍ--relocateÑ¡ÏîͬʱʹÓÃʱ²ÅÓÐÒâÒå¡£
ÈçÉÏÀý£¬²ÉÓò¢²»´æÔÚµÄÖض¨Î»Ç°×º/usr/man½øÐа²×°£º
# rpm -i --relocate /usr/man=/tmp file-3.26-6.i386.rpm
path /usr/man is not relocateable for package file-3.26-6
#
RPMÌáʾÁË´íÎó£º/usr/manĿ¼ÔÚfile-3.26-6°üÖÐÊDz»¿ÉÖض¨Î»µÄ¡£
Èç¼ÓÉÏ--badrelocÑ¡Ï½á¹ûÔõôÑù£º
# rpm -i --relocate /usr/man=/tmp --badreloc file-3.26-6.i386.rpm
# rpm -ql file
/usr/bin/file
/tmp/man1/file.1
/tmp/man4/magic.4
/usr/share/magic
#
ÓÉÉÏ¿ÉÒÔ¿´µ½£¬ÕâÑùµÄÇ¿ÖÆÖض¨Î»»ñµÃͨ¹ý£¬Ö®ºóÔÙÓòéѯÃüÁîrpm -qlÁÐÒ»ÏÂfile°üµÄÎļþ£¬¾Í»á·¢ÏÖÔÀ´µÄ/usr/man/man1/file.1¶¨Î»³ÉÁË/tmp/man1/file.1£¬¶ø /usr/man/man4/magic.4Ôò³ÉÁË/tmp/man4/magic.4¡£ÔõôÑù?ÉñÆæ°É!
17.excludepath£º²»°²×°Ö¸¶¨Ä¿Â¼ÏµÄÎļþ
ÀûÓôËÑ¡Ï¿ÉÒÔ½ûÖ¹RPM°²×°Ä³Ð©Ö¸¶¨Ä¿Â¼ÏµÄÎļþ¡£Èç²»Ïë°²×°fileÈí¼þ°üÖеÄ˵Ã÷Îĵµ£¬³ýÁË¿ÉʹÓÃ--excludedocsÑ¡ÏîÍ⣬»¹¿ÉʹÓñ¾Ñ¡Ïî¡£ÒòΪfileµÄ˵Ã÷Îĵµ¾ùÔÚĿ¼/usr/manÏÂÃæ¡£
# rpm -i --excludepath /usr/man file-3.26-6.i386.rpm
# rpm -qls file
normal/usr/bin/file
not installed /usr/man/man1/file.1
not installed /usr/man/man4/magic.4
normal/usr/share/magic
#
×¢£ºÀý×ÓÖÐÏÈ°²×°fileÈí¼þ°ü£¬²¢ÓÃ--excludepath½ûÖ¹°²×°/usr/manϵÄÎļþ£¬ÔÙÓÃRPM²éѯÃüÁîrpm -qlsÁгöfile°üµÄÎļþ¼°×´Ì¬£¬¿ÉÒÔ¿´µ½£º/usr/manϵÄÁ½¸öÎļþ¾ùδ°²×°£¨not installed£©¡£
18.justdb£º½ö¸üÐÂÊý¾Ý¿â
°²×°Èí¼þ°üʹÓôËÑ¡Ïîºó£¬RPM½«Ö»¸üÐÂÆäÊý¾Ý¿âÊý¾Ý£¬Îļþϵͳ²»¸üУ¬Òâ¼´²¢²»¿½±´ºÍ½¨Á¢°üÖеÄÎļþ¡£
# rpm -i --justdb file-3.26-6.i386.rpm
# rpm -qls file
normal/usr/bin/file
normal/usr/man/man1/file.1
normal/usr/man/man4/magic.4
normal/usr/share/magic
# ls -l /usr/bin/file
ls: /usr/bin/file: Îļþ»òĿ¼²»´æÔÚ
#
×¢£ºÀý×ÓÖа²×°file°üµ«Ö¸Ã÷Ö»¸üÐÂÊý¾Ý¿â£¬½á¹ûÊÇ£ºËäÈ»ÓòéѯÃüÁî²éµ½¸ÃÈí¼þ°üÖÐËùÓÐÎļþ״̬¾ùÕý³££¨normal£©£¬µ«ÓÃlsÃüÁîÁаüÖÐËùº¬Îļþ/usr/bin/file£¬¸ÃÎļþÈ´²»´æÔÚ¡£Õâ±íÃ÷°üÖÐÎļþ²¢Î´½¨Á¢¡£
19.prefix£ºÖ¸¶¨Öض¨Î»Ç°×º
ÈçÇ°ËùÊö£¬¿ÉÖض¨Î»µÄÈí¼þ°ü¿Éº¬Ò»¸ö»ò¶à¸öÖض¨Î»Ç°×º£¬¿ÉÓÃ--relocateÑ¡ÏîÀ´¸Ä±äij¸öÖض¨Î»Ç°×ºÖ®Öµ¡£--prefixÑ¡Ïî½öÄÜÓÃÀ´¸Ä±äĬÈϵÄÖض¨Î»Ç°×º£¨Ä¬ÈÏÊǵÚÒ»¸öÖض¨Î»Ç°×º£©£¬Ëü²»ÐèҪ˵Ã÷ÔÖض¨Î»Ç°×º¡£ÏÂÃæµÄÀý×ÓͬÑù½«file°ü°²×°µ½/tmpĿ¼£º
# rpm -qpl file-3.26-6.i386.rpm
/usr/bin/file
/usr/man/man1/file.1
/usr/man/man4/magic.4
/usr/share/magic
# rpm -i --prefix /tmp file-3.26-6.i386.rpm
# rpm -ql file
/tmp/bin/file
/tmp/man/man1/file.1
/tmp/man/man4/magic.4
/tmp/share/magic
#
20.ftpproxy£ºÖ¸¶¨FTP´úÀíÖ÷»ú
±¾Ñ¡ÏîÖ¸¶¨FTP´úÀíÖ÷»ú£¬Ö÷»ú¿ÉÒÔÊÇÖ÷»úÃû£¬Ò²¿ÉÒÔÊÇIPµØÖ·¡£
21.ftpport£ºÖ¸¶¨FTP¶Ë¿Ú
±¾Ñ¡ÏîÖ¸¶¨FTPÐÒéʹÓõÄTCP¶Ë¿Ú£¬ÏµÍ³Ä¬ÈÏÊÇ21¡£
Çë¿´ÏÂÃæµÄÀý×Ó£º
# rpm -iv --ftpport 8888 ftp://root@xwboc/tmp/file-3.26-6.i386.rpm
Password for root@xwboc:
Password for root@xwboc:
Retrieving ftp://root@xwboc/tmp/file-3.26-6.i386.rpm
file-3.26-6
#
±¾ÀýÖÐÓÃFTP·½Ê½°²×°fileÈí¼þ°ü£¬Êý¾Ý´«ÊäʹÓÃ8888¶Ë¿Ú¡£Ö´ÐÐÖУ¬RPMÏÈÌáʾÊäÈërootÓû§µÄÃÜÂëÁ½´Î£¬Ö®ºóÏÂÔØ£¨retrieve£©Èí¼þ£¬×îºó³É¹¦°²×°¡£
22.httpproxy£ºÖ¸¶¨HTTP´úÀíÖ÷»ú
±¾Ñ¡ÏîÖ¸¶¨HTTP´úÀíÖ÷»ú£¬Ö÷»ú¿ÉÒÔÊÇÖ÷»úÃû£¬Ò²¿ÉÒÔÊÇIPµØÖ·¡£
23.httpport£ºÖ¸¶¨HTTP¶Ë¿Ú
±¾Ñ¡ÏîÖ¸¶¨HTTPÐÒéʹÓõÄTCP¶Ë¿Ú£¬ÏµÍ³Ä¬ÈÏÊÇ80¡£
ÏÂÃæµÄÀý×Ó¾ÍÖ¸¶¨ÁË80¶Ë¿ÚÀ´°²×°autofsÈí¼þ£¬µ±È»²»Ö¸¶¨Ò²ÐУ¬ÒòΪϵͳĬÈϵľÍÊÇÕâ¸ö¶Ë¿Ú¡£
# rpm -iv --httpport 80 http://24.109.164.55/rpms/autofs-3.1.3-2.i386.rpm
Retrieving http://24.109.164.55/rpms/autofs-3.1.3-2.i386.rpm
autofs-3.1.3-2
#
×¢£ºÍ¬FTP·½Ê½Ò»Ñù£¬RPM¶¼ÊÇÏÂÔØÔÙ°²×°¡£
¶þ¡¢Í¨ÓÃÑ¡Ïî
ËùνͨÓÃÑ¡Ï¾ÍÊDz»¹ÜÊÇ°²×°£¬Éý¼¶£¬Ð¶ÔØ»¹ÊÇÆäËüÈí¼þ°ü²Ù×÷£¬Í³Í³ÊÊÓõÄÑ¡Ïî¡£
ÕâÑùµÄÑ¡ÏîÖ÷ÒªÒÔϼ¸¸ö£º
1.-v£ºÏÔʾ¸½¼ÓÐÅÏ¢
Ò»°ãÇé¿öÏ£¬RPMºÍ²»ÉÙLINUXÃüÁÈçcp£¬rm£¬mvµÈ£©Ò»Ñù£¬¶¼±¾×ž¡¿ÉÄÜÉÙÊä³öÐÅÏ¢µÄÔÔò£¨³ý·Ç±ØÒª£¬·ñÔò²»ÒªÊä³ö£©£¬ÕâÑù×öÊÇΪÁ˱ÜÃâÀË·Ñ CPU×ÊÔ´¡£ËùÒÔ£¬µ±Óû§Ê¹ÓÃij¸öÃüÁîºóûÓÐʲôÊä³ö£¬Õâ¾ÍÒâζ×ÅÃüÁîÖ´Ðгɹ¦ÁË¡£Èç¹ûÓÐʲô´íÎ󣬳ÌÐò»áÌáʾµÄ¡£RPMÒ²ÊÇÕâ¸öÑù×Ó¡£ÎªÁËʹRPMÊä³ö¶àÒ»µãµÄÐÅÏ¢£¬¿ÉÒÔʹÓÃ-vÑ¡Ïî¡£
Èç²»´ø´ËÑ¡Ïî°²×°file°ü£¬Ã»ÓÐÊä³ö£º
# rpm -i file-3.26-6.i386.rpm
#
¶ø²ÉÓÃ-vÑ¡Ïîºó°²×°Ê±Êä³öÁË°üÃû£º
# rpm -i -v file-3.26-6.i386.rpm
file-3.26-6
#
2.-vv£ºÏÔʾµ÷ÊÔÐÅÏ¢
Ñ¡ÓÃ-vvÑ¡Ï¿ÉÒÔʹRPMÊä³ö¸ü¶àµÄÐÅÏ¢¡£ÕâЩÐÅÏ¢£¬Ö÷Òª¹©RPMÈí¼þ¿ª·¢ÕßÑо¿Ê¹Óõģ¬Ò»°ãÓû§Ò²¿ÉÒÔ¿´¿´£¬´ÓÖпÉÒÔÖªµÀRPM¾¿¾¹¸ÉЩʲô¡£
ÏÂÃæ²ÉÓôËÑ¡Ïî°²×°file°ü£¬Í¬Ê±Ê¹ÓùܵÀÏߣ¨|£©½«Êä³öÊý¾ÝËÍnlÃüÁÒÔ´øÐкÅÊä³öÿÐÐÊý¾Ý¡£
´ÓÖ´Ðнá¹û¿´£¬Êä³öµÄÐÅÏ¢ºÜ¶à£¬ÆäÖÐÒÔD:¿ªÍ·µÄÐоùÊǵ÷ÊÔÐÅÏ¢¡£ÏÖÔÚÖðÐнâÊÍ£º
µÚ1ÐУºÍ³¼ÆÒª°²×°µÄÈí¼þ°ü¸öÊý£»
µÚ2ÐУºRPMÕÒµ½1¸ö°ü£»
µÚ3ÐУº²é¿´ÄÄЩ°üÐèÒªÏÂÔØ£¨ÕâЩҪÏÂÔصİü£¬¶¼ÊÇÒÔFTP»òHTTPÐÎʽÊéдµÄ°üÃû£©£»
µÚ4ÐУºÏÂÔØÁË0¸ö°ü£»
µÚ5-10ÐУºÈ¡°ü¹üÎļþµÄÎļþÍ·ÐÅÏ¢£¬Ëã³öÈí¼þ°üÕ¼ÓõĿռä68019£¨×Ö½Ú£©£¬ÒÔÀû¼ì²é
ϵͳÊÇ·ñÓÐ×ã¹»¿Õ¼ä¡£
µÚ11ÐУº´ò¿ªRPMÊý¾Ý¿â£»
µÚ12ÐУºÕÒµ½0¸öÔ´´úÂë°ü£¬1¸öÖ´ÐдúÂë°ü£»
µÚ13-18ÐУº¼ì²éÈí¼þ°üµÄÒÀÀµ¹Øϵ¡£ÆäÒÀÀµ£¨requires£©µÄ¶«Î÷¾ùµÃµ½Âú×㣨satisfied£©¡£
µÚ19ÐУº×¼±¸°²×°Ö´ÐдúÂë°ü£»
µÚ20ÐУºÈ¡µÃÒÑ°²×°ÎļþϵͳµÄÁÐ±í£»
µÚ21-26ÐУºÔÙ¶ÈÈ¡°ü¹üÎļþÍ·ÐÅÏ¢£¬Ëã³öÈí¼þ°üÕ¼Óÿռ䣻
µÚ27-31ÐУºÁгö°üÖÐÎļþ¼°ÒªÖ´ÐеIJÙ×÷£¬µÚ27ÐеÄtest=0±íʾ²»ÊǽøÐа²×°²âÊÔ£¬
file°üÖеÄÎļþ¾ùÒªÖ´Ðд´½¨²Ù×÷£¨create£©¡£
µÚ32ÐУºÈç¹ûÓа²×°Ç°Ö´Ðнű¾³ÌÐòµÄ»°£¬Ö´ÐÐËü£»
µÚ33ÐУº°²×°Èí¼þ°üfile-3.26-6£»
µÚ34ÐУºÈç¹ûÓа²×°ºóÖ´Ðнű¾³ÌÐòµÄ»°£¬Ö´ÐÐËü¡£
3.root£ºÖ¸¶¨¸ùĿ¼
Ö¸¶¨¸ùĿ¼ROOT£¬Æä×÷ÓÃÔÚÓÚ½«ÏµÍ³ËùÓвÙ×÷ÏÞ¶¨ÔÚÖ¸¶¨µÄĿ¼ÏÂÃ棬ÕâÑùRPM²Ù×÷µÄÊý¾Ý¿âλÖñäÁË£¬Èí¼þ°üµÄ°²×°Î»ÖÃÒ²±äÁË¡£ËüÊÇͨ¹ýchrootϵͳµ÷ÓÃʵÏֵġ£RPMĬÈϵÄÊý¾Ý¿âĿ¼ÊÇ/var/lib/rpm£¬Èç¹ûÖ¸¶¨¸ùĿ¼Ϊ/usr£¬ÔòRPMµÄÊý¾Ý¿âĿ¼½«±äΪ /usr/var/lib/rpm¡£Í¬Ñù£¬Èç¹û°üÖÐÓиöÎļþΪ/etc/zhsoft.txt£¬Ôò°²×°ºóΪ/usr/etc/zhsoft.txt¡£
¿´ÏÂÃæµÄÀý×Ó£º
# rpm -i --root /usr file-3.26-6.i386.rpm
failed to open /usr/var/lib/rpm/packages.rpm
error: ²»ÄÜ´ò¿ª /usr/var/lib/rpm/packages.rpm
#
×¢£ºÖ¸¶¨RPM¸ùĿ¼Ϊ/usr°²×°file³öÏÖ´íÎó£¬RPM´ò²»¿ª/usr/var/lib/rpm/packages.rpmÎļþ£¬ÕâÊÇÒòΪʵ¼ÊÉÏÔÚ /usr/var/lib/rpmĿ¼ÏÂûÓÐÈκÎRPMÊý¾Ý¿â¡£Èç¹ûÏë³É¹¦°²×°£¬¿ÉÓóõʼ»¯RPMÊý¾Ý¿âÃüÁîÀ´½¨Á¢RPMÊý¾Ý¿â£¬ÃüÁîÊÇrpm --initdb --root /usr£¨ÕâЩ¹¦Äܽ«ÔÚÒÔºó½²µ½£©¡£
4.rcfile£ºÖ¸¶¨RPM×ÊÔ´ÅäÖÃÎļþ
RPMµÄ×ÊÔ´ÅäÖÃÎļþÀ´æ·Å×ÅRPMµÄĬÈÏÉèÖã¬ÓбàÒëÑ¡Ïîoptflags£¬Ìåϵ¶¨Òåarch_canon£¬¼æÈݶ¨Òåarch_compat£¬ºêÎļþ¶¨ÒåmacrofilesµÈ¡£RPMĬÈϵÄ×ÊÔ´ÅäÖÃÎļþ£¨°´¶Áȡ˳Ðò£©Îª£º/usr/lib/rpm/rpmrc£¬/etc/rpmrc£¬ ~/.rpmrc¡££¨ºóÁ½¸öÎļþÏÖÔÚÒâÒå²»´óÁË£¬Èç½ñÒ»°ã»»×÷RPMºêÎļþÁË¡£½ÏÖ®×ÊÔ´ÅäÖÃÎļþ£¬ºêÎļþÓиü´óµÄÁé»îÐÔ¡££©
Èç¹ûÏëÈÃRPMʹÓÃÓû§Ö¸¶¨µÄ×ÊÔ´ÅäÖÃÎļþ£¬¾ÍÓÃ--rcfileÀ´É趨£¬¿ÉͬʱÉ趨¶à¸öÎļþ£¬Îļþ¼äÒÔðºÅ£¨:£©·Ö¸ô£¬Èç/usr/lib/rpm/rpmrc:/etc/rpmrc:~/.rpmrcÕâÖÖÐÎʽ¡£
5.dbpath£ºÖ¸¶¨RPMÊý¾Ý¿âĿ¼
±¾Ñ¡ÏͬÓÚ--rootÑ¡ÏËü½ö½öÊÇÖ¸¶¨RPMÊý¾Ý¿âµÄĿ¼£¬²¢²»¸Ä±ä°²×°ÎļþµÄλÖá£