{"id":4273,"date":"2012-11-25T14:06:12","date_gmt":"2012-11-25T06:06:12","guid":{"rendered":"http:\/\/jpuyy.com\/?p=4273"},"modified":"2015-08-24T17:14:45","modified_gmt":"2015-08-24T09:14:45","slug":"rpm-usage","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=4273","title":{"rendered":"rpm\u547d\u4ee4"},"content":{"rendered":"<p>\u7528CentOS\u4e5f\u6709\u4e00\u6bb5\u65f6\u95f4\u4e86\uff0c\u6574\u7406\u4e00\u4e0brpm\u547d\u4ee4\u7684\u7528\u6cd5<\/p>\n<p>\u5b89\u88c5.rpm\u7684\u6587\u4ef6\uff0c-i\u4ee3\u8868&#8211;install\uff0c-v\u4ee3\u8868&#8211;verbose\uff0c-h\u4ee3\u8868&#8211;hash \u4ee5#\u663e\u793a\u5b89\u88c5\u8fdb\u5ea6<\/p>\n<pre>rpm -ivh package.rpm<\/pre>\n<p>\u5347\u7ea7\u8f6f\u4ef6\u5305<\/p>\n<pre>rpm -U packupdate.rpm<\/pre>\n<p>\u67e5\u770b\u5df2\u7ecf\u5b89\u88c5\u7684\u8f6f\u4ef6<\/p>\n<p>\u5217\u51fa\u5df2\u7ecf\u5b89\u88c5\u7684\u5168\u90e8\u8f6f\u4ef6\u5305\uff0c\u67e5\u5177\u4f53\u5305\u53ef\u63a5 | grep \u6765\u7b5b\u9009\uff0c\u6216\u4f7f\u7528\u901a\u914d\u7b26<\/p>\n<pre>rpm -qa<\/pre>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre># rpm -qa httpd* \r\nhttpd-tools-2.2.15-15.el6.centos.1.x86_64\r\nhttpd-2.2.15-15.el6.centos.1.x86_64\r\n\u6216\r\n# rpm -qa | grep http\r\nhttpd-tools-2.2.15-15.el6.centos.1.x86_64\r\nhttpd-2.2.15-15.el6.centos.1.x86_64<\/pre>\n<p>\u627e\u5230\u67d0\u6587\u4ef6\u5c5e\u4e8e\u54ea\u4e2a\u8f6f\u4ef6\u5305\uff0c\u4f7f\u7528<\/p>\n<pre>rpm -qf filename<\/pre>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>rpm -qf \/etc\/httpd\/conf\/httpd.conf<\/pre>\n<p>\u6267\u884c\u7ed3\u679c\uff1a\u00a0httpd-2.2.15-15.el6.centos.1.x86_64<\/p>\n<p>-qi \u67e5\u770b\u5df2\u7ecf\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u7684\u529f\u80fd\uff0c<\/p>\n<pre>rpm -qi packagename<\/pre>\n<p>-pqi \u67e5\u770b\u6ca1\u6709\u5b89\u88c5\u7684.rpm\u5305\u7684\u8be6\u7ec6\u4fe1\u606f<\/p>\n<pre>[root@localhost ~]# rpm -pqi epel-release-6-8.noarch.rpm \r\nName        : epel-release                 Relocations: (not relocatable)\r\nVersion     : 6                                 Vendor: Fedora Project\r\nRelease     : 8                             Build Date: Mon 05 Nov 2012 11:54:41 AM CST\r\nInstall Date: (not installed)               Build Host: buildvm-05.phx2.fedoraproject.org\r\nGroup       : System Environment\/Base       Source RPM: epel-release-6-8.src.rpm\r\nSize        : 22169                            License: GPLv2\r\nSignature   : RSA\/8, Mon 05 Nov 2012 11:29:49 PM CST, Key ID 3b49df2a0608b895\r\nPackager    : Fedora Project\r\nURL         : http:\/\/dl.fedoraproject.org\/pub\/epel\/\r\nSummary     : Extra Packages for Enterprise Linux repository configuration\r\nDescription :\r\nThis package contains the Extra Packages for Enterprise Linux (EPEL) repository\r\nGPG key as well as configuration for yum and up2date.<\/pre>\n<p>\u5982\u67e5\u770bwget\u7684\u529f\u80fd\u8bf4\u660e<\/p>\n<pre>rpm -qi wget<\/pre>\n<p>\u5220\u9664\u5df2\u7ecf\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305<\/p>\n<pre>rpm -e packagename<\/pre>\n<p>\u67e5\u770b\u5df2\u7ecf\u5b89\u88c5\u597d\u7684\u8f6f\u4ef6\u5305\u90fd\u5305\u542b\u54ea\u4e9b\u6587\u4ef6<\/p>\n<pre>rpm -ql iptables<\/pre>\n<p>\u67e5\u770b\u67d0\u4e2a rpm \u5305\u5305\u542b\u6709\u54ea\u4e9b\u6587\u4ef6<\/p>\n<pre>rpm -qlp package.rpm<\/pre>\n<p>\u5bf9\u4e8e yum \u6e90\u91cc\u6ca1\u6709\u5b89\u88c5\u5728\u672c\u673a\u7684 rpm \u5305\u67e5\u770b\u8981\u88c5\u54ea\u4e9b\u6587\u4ef6\uff0c\u53ef\u4ee5\u8fd9\u6837\u67e5(\u524d\u63d0\u8981\u5b89\u88c5\u597dyum-utils)<\/p>\n<pre>repoquery -q -l --plugins memcached<\/pre>\n<p>\u53c2\u8003\uff1ahttp:\/\/www.cyberciti.biz\/faq\/howto-list-find-files-in-rpm-package\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7528CentOS\u4e5f\u6709\u4e00\u6bb5\u65f6\u95f4\u4e86\uff0c\u6574\u7406\u4e00\u4e0brpm\u547d\u4ee4\u7684\u7528\u6cd5 \u5b89\u88c5.rpm\u7684\u6587\u4ef6\uff0c-i\u4ee3\u8868&#8211;install\uff0c-v\u4ee3\u8868&#8211;verbose\uff0c-h\u4ee3\u8868&#8211;hash \u4ee5#\u663e\u793a\u5b89\u88c5\u8fdb\u5ea6 rpm -ivh package.rpm \u5347\u7ea7\u8f6f\u4ef6\u5305 rpm -U packupdate.rpm \u67e5\u770b\u5df2\u7ecf\u5b89\u88c5\u7684\u8f6f\u4ef6 \u5217\u51fa\u5df2\u7ecf\u5b89\u88c5\u7684\u5168\u90e8\u8f6f\u4ef6\u5305\uff0c\u67e5\u5177\u4f53\u5305\u53ef\u63a5 | grep \u6765\u7b5b\u9009\uff0c\u6216\u4f7f\u7528\u901a\u914d\u7b26 rpm -qa \u4f8b\u5982\uff1a # rpm -qa httpd* httpd-tools-2.2.15-15.el6.centos.1.x86_64 httpd-2.2.15-15.el6.centos.1.x86_64 \u6216 # rpm -qa | grep http httpd-tools-2.2.15-15.el6.centos.1.x86_64 httpd-2.2.15-15.el6.centos.1.x86_64 \u627e\u5230\u67d0\u6587\u4ef6\u5c5e\u4e8e\u54ea\u4e2a\u8f6f\u4ef6\u5305\uff0c\u4f7f\u7528 rpm -qf filename \u4f8b\u5982\uff1a rpm -qf \/etc\/httpd\/conf\/httpd.conf \u6267\u884c\u7ed3\u679c\uff1a\u00a0httpd-2.2.15-15.el6.centos.1.x86_64 -qi \u67e5\u770b\u5df2\u7ecf\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u7684\u529f\u80fd\uff0c rpm -qi packagename -pqi \u67e5\u770b\u6ca1\u6709\u5b89\u88c5\u7684.rpm\u5305\u7684\u8be6\u7ec6\u4fe1\u606f [root@localhost ~]# rpm -pqi epel-release-6-8.noarch.rpm Name [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[118],"class_list":["post-4273","post","type-post","status-publish","format-standard","hentry","category-linux","tag-rpm"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/4273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4273"}],"version-history":[{"count":16,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/4273\/revisions"}],"predecessor-version":[{"id":7539,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/4273\/revisions\/7539"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}