{"id":165265,"date":"2019-12-16T12:16:32","date_gmt":"2019-12-16T04:16:32","guid":{"rendered":"https:\/\/gulass.cn\/?p=165265"},"modified":"2019-11-26T11:17:26","modified_gmt":"2019-11-26T03:17:26","slug":"rpm-redhat","status":"publish","type":"post","link":"https:\/\/gulass.cn\/rpm-redhat.html","title":{"rendered":"RPM\u5e38\u7528\u547d\u4ee4\u4ecb\u7ecd"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nrpm\u547d\u4ee4\u662fRPM\u8f6f\u4ef6\u5305\u7684\u7ba1\u7406\u5de5\u5177\u3002rpm\u539f\u672c\u662fRed Hat Linux\u53d1\u884c\u7248\u4e13\u95e8\u7528\u6765\u7ba1\u7406Linux\u5404\u9879\u5957\u4ef6\u7684\u7a0b\u5e8f\uff0c\u7531\u4e8e\u5b83\u9075\u5faaGPL\u89c4\u5219\u4e14\u529f\u80fd\u5f3a\u5927\u65b9\u4fbf\uff0c\u56e0\u800c\u5e7f\u53d7\u6b22\u8fce\u3002\u9010\u6e10\u53d7\u5230\u5176\u4ed6\u53d1\u884c\u7248\u7684\u91c7\u7528\u3002RPM\u5957\u4ef6\u7ba1\u7406\u65b9\u5f0f\u7684\u51fa\u73b0\uff0c\u8ba9Linux\u6613\u4e8e\u5b89\u88c5\uff0c\u5347\u7ea7\uff0c\u95f4\u63a5\u63d0\u5347\u4e86Linux\u7684\u9002\u7528\u5ea6\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u5b89\u88c5<\/strong><\/span><\/div>\n
rpm -ivh package_name<\/pre>\n

(package_name\u6307\u7684\u662fRPM\u5305\u7684\u6587\u4ef6\u540d)<\/p>\n

\u67e5\u8be2<\/strong><\/span><\/div>\n

1.\u67e5\u8be2\u662f\u5426\u5b89\u88c5\uff0c\u53ca\u5b89\u88c5\u7248\u672c<\/p>\n

rpm -q \u5df2\u5b89\u88c5\u7684\u8f6f\u4ef6\u540d\uff08ex:rpm -q docker-engine)\r\n\r\nrpm -qa\u00a0|grep \u5b57\u7b26\u4e32\uff08\u5728\u5df2\u5b89\u88c5\u7684\u6240\u6709\u8f6f\u4ef6\u4e2d\u67e5\u8be2\u5305\u542b\u67d0\u5b57\u7b26\u4e32\u7684\u8f6f\u4ef6\u7248\u672c\uff09<\/pre>\n

2.\u67e5\u8be2\u76f8\u5173\u914d\u7f6e\u6587\u4ef6<\/p>\n

rpm -ql \u8f6f\u4ef6\u540d\uff08\u5217\u51fa\u8be5\u8f6f\u4ef6\u6240\u6709\u6587\u4ef6\u4e0e\u76ee\u5f55\u6240\u5728\u7684\u5b8c\u6574\u6587\u4ef6\u540d\uff09\r\n\r\nrpm -qc \u8f6f\u4ef6\u540d\uff08\u5217\u51fa\u8f6f\u4ef6\u7684\u6240\u6709\u8bbe\u7f6e\u6587\u4ef6\uff09<\/pre>\n

3.\u67e5\u8be2\u67d0\u8f6f\u4ef6\u4f9d\u8d56\u7684\u5176\u4ed6\u8f6f\u4ef6<\/p>\n

rpm -qR \u8f6f\u4ef6\u540d<\/pre>\n

4.\u67e5\u8be2\u6587\u4ef6\u5c5e\u4e8e\u54ea\u4e2a\u8f6f\u4ef6\u5305<\/p>\n

rpm -qf \u6587\u4ef6\u540d<\/pre>\n
\u5378\u8f7d<\/strong><\/span><\/div>\n
rpm -e --nodeps package_name<\/pre>\n
\u9a8c\u8bc1<\/strong><\/span><\/div>\n
rpm -V \u5df2\u5b89\u88c5\u7684\u8f6f\u4ef6\u540d \uff08\u5217\u51fa\u8be5\u8f6f\u4ef6\u88ab\u4fee\u6539\u8fc7\u7684\u914d\u7f6e\u6587\u4ef6)\r\n\r\nrpm -Vf \u6587\u4ef6\u540d \uff08\u5217\u51fa\u67d0\u4e2a\u6587\u4ef6\u662f\u5426\u88ab\u6539\u52a8\u8fc7)<\/pre>\n
\u56de\u9000\u5230\u4f4e\u7248\u672c<\/strong><\/span><\/div>\n
rpm --Uvh --oldpackage --nodeps package_name<\/pre>\n

\uff08\u6b64\u547d\u4ee4\u5305\u542b\u5378\u8f7d\u6e90\u73af\u5883\u4e2d\u7684\u8f6f\u4ef6\u5305\uff0c\u548c\u5b89\u88c5\u4f4e\u7248\u672c\u8f6f\u4ef6\u5305\u7684\u4e24\u4e2a\u6b65\u9aa4\uff09<\/p>\n

\u5907\u4efd\u5de5\u5177<\/strong><\/span><\/div>\n
rpmrebuild<\/pre>\n

\u4f5c\u7528\uff1a\u5907\u4efd\u5df2\u7ecf\u5b89\u88c5\u5728\u73af\u5883\u7684\u7684\u8f6f\u4ef6<\/p>\n

\u7528\u6cd5\uff1arpmrebuild pacakge_name<\/pre>\n

\u5982\u679c\u8f6f\u4ef6\u7684\u76f8\u5173\u914d\u7f6e\u88ab\u6539\u52a8\u8fc7\uff0c\u8be5\u547d\u4ee4\u4f1a\u8be2\u95ee\u662f\u5426\u7ee7\u7eed\uff0c\u4ee5\u53ca\u662f\u5426\u8981\u547d\u540d\u4e00\u4e2a\u65b0\u7684\u8f6f\u4ef6\u7248\u672c\u540d<\/p>\n

\u5982\u679c\u4e0d\u9700\u8981\u6b64\u8be2\u95ee \u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n

rpmrebuild -b<\/pre>\n","protected":false},"excerpt":{"rendered":"

rpm -ivh package_name (package_name\u6307\u7684\u662fRPM\u5305\u7684\u6587\u4ef6\u540d) 1.\u67e5\u8be2\u662f\u5426\u5b89 […]<\/p>\n","protected":false},"author":63,"featured_media":165273,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-165265","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/165265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=165265"}],"version-history":[{"count":4,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/165265\/revisions"}],"predecessor-version":[{"id":165291,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/165265\/revisions\/165291"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/165273"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=165265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=165265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=165265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}