{"id":39927,"date":"2023-02-09T13:53:40","date_gmt":"2023-02-09T05:53:40","guid":{"rendered":"http:\/\/gulass.cn\/?p=39927"},"modified":"2023-02-09T13:53:40","modified_gmt":"2023-02-09T05:53:40","slug":"download-allrpm-relevant","status":"publish","type":"post","link":"https:\/\/gulass.cn\/download-allrpm-relevant.html","title":{"rendered":"\u600e\u6837\u5728 CentOS \u91cc\u4e0b\u8f7d RPM \u5305\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u5305"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u524d\u51e0\u5929\u6211\u5c1d\u8bd5\u53bb\u521b\u5efa\u4e00\u4e2a\u4ec5\u5305\u542b\u6211\u4eec\u7ecf\u5e38\u5728 CentOS 7 \u4e0b\u4f7f\u7528\u7684\u8f6f\u4ef6\u7684\u672c\u5730\u4ed3\u5e93\u3002\u5f53\u7136\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 curl \u6216\u8005 wget \u4e0b\u8f7d\u4efb\u4f55\u8f6f\u4ef6\u5305\uff0c\u7136\u800c\u8fd9\u4e9b\u547d\u4ee4\u5e76\u4e0d\u80fd\u4e0b\u8f7d\u8981\u6c42\u7684\u4f9d\u8d56\u8f6f\u4ef6\u5305\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u4f60\u5fc5\u987b\u53bb\u82b1\u4e00\u4e9b\u65f6\u95f4\u800c\u4e14\u624b\u52a8\u7684\u53bb\u5bfb\u627e\u548c\u4e0b\u8f7d\u88ab\u5b89\u88c5\u7684\u8f6f\u4ef6\u6240\u4f9d\u8d56\u7684\u8f6f\u4ef6\u5305\u3002\u7136\u800c\uff0c\u6211\u4eec\u5e76\u4e0d\u662f\u5fc5\u987b\u8fd9\u6837\u3002\u5728\u8fd9\u4e2a\u7b80\u77ed\u7684\u6559\u7a0b\u4e2d\uff0c\u6211\u5c06\u4f1a\u5e26\u9886\u4f60\u4ee5\u4e24\u79cd\u65b9\u5f0f\u4e0b\u8f7d\u8f6f\u4ef6\u5305\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u5305\u3002\u6211\u5df2\u7ecf\u5728 CentOS 7 \u4e0b\u8fdb\u884c\u4e86\u6d4b\u8bd5\uff0c\u4e0d\u8fc7\u8fd9\u4e9b\u76f8\u540c\u7684\u6b65\u9aa4\u6216\u8bb8\u5728\u5176\u4ed6\u57fa\u4e8e RPM \u7ba1\u7406\u7cfb\u7edf\u7684\u53d1\u884c\u7248\u4e0a\u4e5f\u53ef\u4ee5\u5de5\u4f5c\uff0c\u4f8b\u5982 RHEL\uff0cFedora \u548c Scientific Linux\u3002<\/p>\n

\u65b9\u6cd51 \u5229\u7528 Downloadonly \u63d2\u4ef6\u4e0b\u8f7d RPM \u8f6f\u4ef6\u5305\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u5305<\/strong><\/div>\n

\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 yum \u547d\u4ee4\u7684 Downloadonly \u63d2\u4ef6\u4e0b\u8f7d RPM \u8f6f\u4ef6\u5305\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u5305\u3002
\n\u4e3a\u4e86\u5b89\u88c5 Downloadonly \u63d2\u4ef6\uff0c\u4ee5 root \u8eab\u4efd\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n

yum install yum-plugin-downloadonly\r\n<\/pre>\n

\u73b0\u5728\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u53bb\u4e0b\u8f7d\u4e00\u4e2a RPM \u8f6f\u4ef6\u5305\u3002<\/p>\n

yum install --downloadonly <package-name>\r\n<\/pre>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8fd9\u4e2a\u547d\u4ee4\u5c06\u4f1a\u4e0b\u8f7d\u5e76\u628a\u8f6f\u4ef6\u5305\u4fdd\u5b58\u5230 \/var\/cache\/yum\/ \u7684 rhel-{arch}-channel\/packageslocation \u76ee\u5f55\uff0c\u4e0d\u8fc7\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4e0b\u8f7d\u548c\u4fdd\u5b58\u8f6f\u4ef6\u5305\u5230\u4efb\u4f55\u4f4d\u7f6e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 –downloaddir \u9009\u9879\u6765\u6307\u5b9a\u3002<\/p>\n

yum install --downloadonly --downloaddir=<directory> <package-name>\r\n<\/pre>\n

\u4f8b\u5b50:<\/strong><\/p>\n

yum install --downloadonly --downloaddir=\/root\/mypackages\/ httpd\r\n<\/pre>\n

\u7ec8\u7aef\u8f93\u51fa:<\/p>\n

Loaded plugins: fastestmirror\r\nLoading mirror speeds from cached hostfile\r\n * base: centos.excellmedia.net\r\n * epel: epel.mirror.angkasa.id\r\n * extras: centos.excellmedia.net\r\n * updates: centos.excellmedia.net\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package httpd.x86_64 0:2.4.6-40.el7.centos.4 will be installed\r\n--> Processing Dependency: httpd-tools = 2.4.6-40.el7.centos.4 for package: httpd-2.4.6-40.el7.centos.4.x86_64\r\n--> Processing Dependency: \/etc\/mime.types for package: httpd-2.4.6-40.el7.centos.4.x86_64\r\n--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64\r\n--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64\r\n--> Running transaction check\r\n---> Package apr.x86_64 0:1.4.8-3.el7 will be installed\r\n---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed\r\n---> Package httpd-tools.x86_64 0:2.4.6-40.el7.centos.4 will be installed\r\n---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed\r\n--> Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n=======================================================================================================================================\r\n Package Arch Version Repository Size\r\n=======================================================================================================================================\r\nInstalling:\r\n httpd x86_64 2.4.6-40.el7.centos.4 updates 2.7 M\r\nInstalling for dependencies:\r\n apr x86_64 1.4.8-3.el7 base 103 k\r\n apr-util x86_64 1.5.2-6.el7 base 92 k\r\n httpd-tools x86_64 2.4.6-40.el7.centos.4 updates 83 k\r\n mailcap noarch 2.1.41-2.el7 base 31 k\r\n\r\nTransaction Summary\r\n=======================================================================================================================================\r\nInstall 1 Package (+4 Dependent packages)\r\n\r\nTotal download size: 3.0 M\r\nInstalled size: 10 M\r\nBackground downloading packages, then exiting:\r\n(1\/5): apr-1.4.8-3.el7.x86_64.rpm | 103 kB 00:00:01 \r\n(2\/5): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:01 \r\n(3\/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:01 \r\n(4\/5): httpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm | 83 kB 00:00:01 \r\n(5\/5): httpd-2.4.6-40.el7.centos.4.x86_64.rpm | 2.7 MB 00:00:09 \r\n---------------------------------------------------------------------------------------------------------------------------------------\r\nTotal 331 kB\/s | 3.0 MB 00:00:09 \r\nexiting because \"Download Only\" specified\r\n<\/pre>\n

\"\u600e\u6837\u5728
\n\u73b0\u5728\u53bb\u4f60\u6307\u5b9a\u7684\u76ee\u5f55\u4f4d\u7f6e\u4e0b\uff0c\u4f60\u5c06\u4f1a\u770b\u5230\u90a3\u91cc\u6709\u4e0b\u8f7d\u597d\u7684\u8f6f\u4ef6\u5305\u548c\u4f9d\u8d56\u7684\u8f6f\u4ef6\u3002\u5728\u6211\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u5df2\u7ecf\u628a\u8f6f\u4ef6\u5305\u4e0b\u8f7d\u5230 \/root\/mypackages\/ \u76ee\u5f55\u4e0b\u3002\u8ba9\u6211\u4eec\u6765\u67e5\u770b\u4e00\u4e0b\u5185\u5bb9:<\/p>\n

ls \/root\/mypackages\/\r\n<\/pre>\n

\u6837\u672c\u8f93\u51fa\uff1a<\/p>\n

apr-1.4.8-3.el7.x86_64.rpm\r\napr-util-1.5.2-6.el7.x86_64.rpm\r\nhttpd-2.4.6-40.el7.centos.4.x86_64.rpm\r\nhttpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm\r\nmailcap-2.1.41-2.el7.noarch.rpm\r\n<\/pre>\n

\"\u600e\u6837\u5728
\n\u6b63\u5982\u4f60\u5728\u4e0a\u9762\u8f93\u51fa\u6240\u770b\u5230\u7684, httpd\u8f6f\u4ef6\u5305\u5df2\u7ecf\u88ab\u4f9d\u636e\u6240\u6709\u4f9d\u8d56\u6027\u4e0b\u8f7d\u5b8c\u6210\u4e86 \u3002
\n\u8bf7\u6ce8\u610f\uff0c\u8fd9\u4e2a\u63d2\u4ef6\u9002\u7528\u4e8e yum install\/yum update\uff0c \u4f46\u662f\u5e76\u4e0d\u9002\u7528\u4e8e yum groupinstall \u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8fd9\u4e2a\u63d2\u4ef6\u5c06\u4f1a\u4e0b\u8f7d\u4ed3\u5e93\u4e2d\u6700\u65b0\u53ef\u7528\u7684\u8f6f\u4ef6\u5305\u3002\u7136\u800c\u4f60\u53ef\u4ee5\u901a\u8fc7\u6307\u5b9a\u7248\u672c\u53f7\u6765\u4e0b\u8f7d\u67d0\u4e2a\u7279\u5b9a\u7684\u8f6f\u4ef6\u7248\u672c\u3002
\n\u4f8b\u5b50:<\/strong><\/p>\n

yum install --downloadonly --downloaddir=\/root\/mypackages\/ httpd-2.2.6-40.el7\r\n<\/pre>\n

\u6b64\u5916\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5982\u4e0b\u4e00\u6b21\u6027\u4e0b\u8f7d\u591a\u4e2a\u5305\uff1a<\/p>\n

yum install --downloadonly --downloaddir=\/root\/mypackages\/ httpd vsftpd\r\n<\/pre>\n
\u65b9\u6cd5 2\u4f7f\u7528 Yumdownloader \u5de5\u5177\u6765\u4e0b\u8f7d RPM \u8f6f\u4ef6\u5305\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u5305<\/strong><\/div>\n

Yumdownloader\u662f\u4e00\u6b3e\u7b80\u5355\uff0c\u4f46\u662f\u5374\u5341\u5206\u6709\u7528\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u4e00\u6b21\u6027\u4e0b\u8f7d\u4efb\u4f55 RPM \u8f6f\u4ef6\u5305\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u5305\u3002
\n\u4ee5 root \u8eab\u4efd\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5 Yumdownloader \u5de5\u5177\u3002<\/p>\n

yum install yum-utils\r\n<\/pre>\n

\u4e00\u65e6\u5b89\u88c5\u5b8c\u6210\uff0c\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\u53bb\u4e0b\u8f7d\u4e00\u4e2a\u8f6f\u4ef6\u5305\uff0c\u4f8b\u5982 httpd\u3002<\/p>\n

yumdownloader httpd\r\n<\/pre>\n

\u4e3a\u4e86\u6839\u636e\u6240\u6709\u4f9d\u8d56\u6027\u4e0b\u8f7d\u8f6f\u4ef6\u5305\uff0c\u6211\u4eec\u4f7f\u7528 --resolve\u53c2\u6570\uff1a<\/p>\n

yumdownloader --resolve httpd\r\n<\/pre>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cYumdownloader \u5c06\u4f1a\u4e0b\u8f7d\u8f6f\u4ef6\u5305\u5230\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u4e0b\u3002
\n\u4e3a\u4e86\u5c06\u8f6f\u4ef6\u4e0b\u8f7d\u5230\u4e00\u4e2a\u7279\u5b9a\u7684\u76ee\u5f55\u4e0b\uff0c\u6211\u4eec\u4f7f\u7528 --destdir \u53c2\u6570\uff1a<\/p>\n

yumdownloader --resolve --destdir=\/root\/mypackages\/ httpd\r\n<\/pre>\n

\u6216\u8005\uff0c<\/p>\n

yumdownloader --resolve --destdir \/root\/mypackages\/ httpd\r\n<\/pre>\n

\u7ec8\u7aef\u8f93\u51fa\uff1a<\/p>\n

Loaded plugins: fastestmirror\r\nLoading mirror speeds from cached hostfile\r\n * base: centos.excellmedia.net\r\n * epel: epel.mirror.angkasa.id\r\n * extras: centos.excellmedia.net\r\n * updates: centos.excellmedia.net\r\n--> Running transaction check\r\n---> Package httpd.x86_64 0:2.4.6-40.el7.centos.4 will be installed\r\n--> Processing Dependency: httpd-tools = 2.4.6-40.el7.centos.4 for package: httpd-2.4.6-40.el7.centos.4.x86_64\r\n--> Processing Dependency: \/etc\/mime.types for package: httpd-2.4.6-40.el7.centos.4.x86_64\r\n--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64\r\n--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64\r\n--> Running transaction check\r\n---> Package apr.x86_64 0:1.4.8-3.el7 will be installed\r\n---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed\r\n---> Package httpd-tools.x86_64 0:2.4.6-40.el7.centos.4 will be installed\r\n---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed\r\n--> Finished Dependency Resolution\r\n(1\/5): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:01 \r\n(2\/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:02 \r\n(3\/5): apr-1.4.8-3.el7.x86_64.rpm | 103 kB 00:00:02 \r\n(4\/5): httpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm | 83 kB 00:00:03 \r\n(5\/5): httpd-2.4.6-40.el7.centos.4.x86_64.rpm | 2.7 MB 00:00:19\r\n<\/pre>\n

\"\u600e\u6837\u5728
\n\u8ba9\u6211\u4eec\u786e\u8ba4\u4e00\u4e0b\u8f6f\u4ef6\u5305\u662f\u5426\u88ab\u4e0b\u8f7d\u5230\u6211\u4eec\u6307\u5b9a\u7684\u76ee\u5f55\u4e0b\u3002<\/p>\n

ls \/root\/mypackages\/\r\n<\/pre>\n

\u7ec8\u7aef\u8f93\u51fa\uff1a<\/p>\n

apr-1.4.8-3.el7.x86_64.rpm\r\napr-util-1.5.2-6.el7.x86_64.rpm\r\nhttpd-2.4.6-40.el7.centos.4.x86_64.rpm\r\nhttpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm\r\nmailcap-2.1.41-2.el7.noarch.rpm\r\n<\/pre>\n

\"\u600e\u6837\u5728<\/p>\n

\u4e0d\u50cf Downloadonly \u63d2\u4ef6\uff0cYumdownload \u53ef\u4ee5\u4e0b\u8f7d\u4e00\u7ec4\u76f8\u5173\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n

yumdownloader \"@Development Tools\" --resolve --destdir \/root\/mypackages\/\r\n<\/pre>\n

\u5728\u6211\u770b\u6765\uff0c\u6211\u559c\u6b22 Yumdownloader \u66f4\u80dc\u4e8e Yum \u7684 Downloadonly \u63d2\u4ef6\u3002\u4f46\u662f\uff0c\u4e24\u8005\u90fd\u662f\u5341\u5206\u7b80\u5355\u6613\u61c2\u800c\u4e14\u53ef\u4ee5\u5b8c\u6210\u76f8\u540c\u7684\u5de5\u4f5c\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-7937-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/gulass.cn\/download-allrpm-relevant.html<\/a>\u7f16\u8f91\u5458\uff1a\u70e8\u5b50\uff0c\u5ba1\u6838\u5458\uff1a\u51af\u742a<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u524d\u51e0\u5929\u6211\u5c1d\u8bd5\u53bb\u521b\u5efa\u4e00\u4e2a\u4ec5\u5305\u542b\u6211\u4eec\u7ecf\u5e38\u5728 CentOS 7 \u4e0b\u4f7f\u7528\u7684\u8f6f\u4ef6\u7684\u672c\u5730\u4ed3\u5e93\u3002\u5f53\u7136\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 curl \u6216\u8005 wget \u4e0b\u8f7d\u4efb\u4f55\u8f6f\u4ef6\u5305\uff0c\u7136\u800c\u8fd9\u4e9b\u547d\u4ee4\u5e76\u4e0d\u80fd\u4e0b\u8f7d\u8981\u6c42\u7684\u4f9d\u8d56\u8f6f\u4ef6\u5305\u3002\u4f60\u5fc5\u987b\u53bb\u82b1\u4e00\u4e9b\u65f6\u95f4\u800c\u4e14\u624b\u52a8\u7684\u53bb\u5bfb\u627e\u548c\u4e0b\u8f7d\u88ab\u5b89\u88c5\u7684\u8f6f\u4ef6\u6240\u4f9d\u8d56\u7684\u8f6f\u4ef6\u5305\u3002\u7136\u800c\uff0c\u6211\u4eec\u5e76\u4e0d\u662f\u5fc5\u987b\u8fd9\u6837\u3002\u5728\u8fd9\u4e2a\u7b80\u77ed\u7684\u6559\u7a0b\u4e2d\uff0c\u6211\u5c06\u4f1a\u5e26\u9886\u4f60\u4ee5\u4e24\u79cd\u65b9\u5f0f\u4e0b\u8f7d\u8f6f\u4ef6\u5305\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u5305\u3002\u6211\u5df2\u7ecf\u5728 CentOS 7 \u4e0b\u8fdb\u884c\u4e86\u6d4b\u8bd5\uff0c\u4e0d\u8fc7\u8fd9\u4e9b\u76f8\u540c\u7684\u6b65\u9aa4\u6216\u8bb8\u5728\u5176\u4ed6\u57fa\u4e8e RPM \u7ba1\u7406\u7cfb\u7edf\u7684\u53d1\u884c\u7248\u4e0a\u4e5f\u53ef\u4ee5\u5de5\u4f5c\uff0c\u4f8b\u5982 RHEL\uff0cFedora \u548c Scientific Linux\u3002<\/p>\n","protected":false},"author":63,"featured_media":35773,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-39927","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\/39927","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=39927"}],"version-history":[{"count":8,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/39927\/revisions"}],"predecessor-version":[{"id":263847,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/39927\/revisions\/263847"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/35773"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=39927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=39927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=39927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}