{"id":239545,"date":"2022-04-09T11:38:25","date_gmt":"2022-04-09T03:38:25","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=239545"},"modified":"2022-03-31T14:11:13","modified_gmt":"2022-03-31T06:11:13","slug":"centos8-dnf-pkg","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/centos8-dnf-pkg.html","title":{"rendered":"CentOS 8 \u4e2ddnf\u7ba1\u7406\u5668\u5982\u4f55\u4ec5\u4e0b\u8f7d\u4e0d\u5b89\u88c5\u8f6f\u4ef6"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5e0c\u671b\u4ece\u547d\u4ee4\u884c\u4e0b\u8f7d\u7279\u5b9a\u6216\u4e00\u7ec4 RPM \u5305\u800c\u4e0d\u5b89\u88c5\u5b83\u3002\u867d\u7136\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 wget \u547d\u4ee4\u4e0b\u8f7d\uff0c\u4f46 wget \u4e0d\u4f1a\u4e0b\u8f7d\u5b89\u88c5\u5305\u7684\u4f9d\u8d56\u9879\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5728 CentOS 8 \u4e2dDNF\uff08\u6216 yum\uff09\u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u5305\u7ba1\u7406\u5de5\u5177\u3002\u4f7f\u7528 DNF\u6211\u4eec\u53ef\u4ee5\u5b89\u88c5\u3001\u66f4\u65b0\u548c\u5220\u9664 rpm \u5305\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u5b83\u8fd8\u53ef\u4ee5\u7528\u4e8e\u4e0b\u8f7d\u8f6f\u4ef6\u5305\u4ee5\u53ca\u4f9d\u8d56\u9879\uff0c\u800c\u65e0\u9700\u5b89\u88c5\u5b83\u4eec\u3002<\/p>\n

\u4e0b\u8f7d\u6307\u5b9a\u7684RPM\u5b89\u88c5\u5305<\/strong><\/div>\n

\u4e0b\u9762\u4f7f\u7528download<\/code>\u5b50\u547d\u4ee4\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u8f7d\u6307\u5b9a\u5b89\u88c5\u5305\uff1a<\/p>\n

\r\n[root@localhost package]# dnf download cifs-utils\r\n<\/pre>\n

\u8be5\u547d\u4ee4\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u8f7dcifs-utils \u5305\u3002\u5b83\u4e0d\u4f1a\u4e0b\u8f7d\u4f9d\u8d56\u9879\u3002\u4e0b\u9762\u67e5\u770b\u4e00\u4e0b\u662f\u5426\u4e0b\u8f7d\u5b8c\u6210\uff1a
\n\"\"<\/p>\n

\u4e0b\u8f7d RPM \u548c\u4f9d\u8d56\u9879<\/strong><\/div>\n

\u5728 dnf \u4e2d\u4f7f\u7528--downloadonly<\/code>\u9009\u9879\uff0c\u53ef\u4ee5\u4e0b\u8f7d rpm \u5305\u53ca\u5176\u4f9d\u8d56\u9879\u3002\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528--downloaddir<\/code>\u9009\u9879\u6307\u5b9a\u4e0b\u8f7d\u7684\u4f4d\u7f6e\u3002<\/p>\n

\u4e0b\u9762\u5728\/root\/package\u76ee\u5f55\u4e0b\u8f7dansible\u76f8\u5173\u7684\u5b89\u88c5\u5305\uff1a<\/p>\n

\r\n[root@localhost ~]# mkdir \/root\/package\r\n[root@localhost ~]# dnf install -y ansible --downloadonly --downloaddir=\/root\/package\r\n<\/pre>\n

\"\"
\n\u53ef\u4ee5\u9a8c\u8bc1\u4e00\u4e0b\uff0c\u662f\u5426\u5df2\u7ecf\u4e0b\u8f7d\u4e86ansible\u548c\u76f8\u5173\u7684\u4f9d\u8d56\u9879\uff1a
\n\"\"
\n\u73b0\u5728\u6211\u4eec\u5c31\u53ef\u4ee5\u5c06\u8fd9\u4e9b\u5b89\u88c5\u5305\u538b\u7f29\u8d77\u6765\uff0c\u4f20\u5165\u5230\u6ca1\u6709\u8fde\u63a5\u7f51\u7edc\u7684\u670d\u52a1\u5668\u4e2d\u5b89\u88c5\u3002<\/p>\n

\r\n[root@localhost ~]# tar -zcvf ansible-installer.tar.gz \/root\/package\r\n<\/pre>\n

\"\"<\/p>\n

\u4e0b\u8f7d\u4e00\u7ec4\u5b89\u88c5\u5305<\/strong><\/div>\n

\u5047\u8bbe\u6211\u4eec\u8981\u4e0b\u8f7dDevelopment Tools<\/code>\u7ec4\u4e0b\u7684\u6240\u6709\u8f6f\u4ef6\u5305\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\u6765\u5b89\u88c5\uff1a<\/p>\n

\r\n[root@localhost ~]# dnf groupinstall -y \"Development Tools\" --downloadonly --downloaddir=\/root\/package\r\n<\/pre>\n

\"\"
\n\u8fdb\u5165\/root\/package\u76ee\u5f55\uff0c\u9a8c\u8bc1\u4e00\u4e0b\u662f\u5426\u4e0b\u8f7d\u76f8\u5173\u8f6f\u4ef6\u5305
\n\"\"<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u6bcf\u5f53\u6211\u4eec\u4f7f\u7528 dnf \u547d\u4ee4\u4e0b\u8f7d\u5b89\u88c5\u5305\u65f6\uff0c\u5982\u679c\u6ca1\u6709\u4f7f\u7528 --downloadidr<\/code> \u6807\u5fd7\uff0c\u90a3\u4e48\u5305\u5c06\u88ab\u4e0b\u8f7d\u5230
\n\/var\/cache\/dnf\/baseos-xxxx\/packages<\/code>,
\n\/var\/cache\/dnf\/appstream-xxxx\/packages<\/code>,
\n\/var\/cache\/dnf\/epel-xxxx\/packages<\/code>\u76ee\u5f55\u4e2d\u3002<\/p>\n

\"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728 CentOS 8 \u4e2dDNF\uff08\u6216 yum\uff09\u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u5305\u7ba1\u7406\u5de5\u5177\u3002\u4f7f\u7528 DNF\u6211\u4eec\u53ef\u4ee5\u5b89\u88c5\u3001\u66f4\u65b0\u548c\u5220\u9664 rp […]<\/p>\n","protected":false},"author":309,"featured_media":239546,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-239545","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/239545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=239545"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/239545\/revisions"}],"predecessor-version":[{"id":239570,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/239545\/revisions\/239570"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/239546"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=239545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=239545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=239545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}