{"id":14241,"date":"2022-09-28T09:19:19","date_gmt":"2022-09-28T01:19:19","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=14241"},"modified":"2022-09-28T09:19:38","modified_gmt":"2022-09-28T01:19:38","slug":"cd-yum-source","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/cd-yum-source.html","title":{"rendered":"\u5c0f\u51e1\u5e26\u4f60\u642d\u5efa\u672c\u5730\u7684\u5149\u76d8yum\u6e90"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n
\n\u5f53\u6211\u4eec\u5728\u4f7f\u7528Yum\u5de5\u5177\u5b89\u88c5\u8f6f\u4ef6\u5305\u65f6\uff0c\u6211\u4eec\u4f1a\u611f\u89c9\u975e\u5e38\u7b80\u5355\uff0c\u5b83\u89e3\u51b3\u4e86\u4e00\u5b9a\u7a0b\u5ea6\u8f6f\u4ef6\u5305\u7684\u4f9d\u8d56\u5173\u7cfb\u3002\u4f46\u662fYum\u5de5\u5177\u9ed8\u8ba4\u63d0\u4f9b\u7684\u662f\u4e00\u79cd\u5728\u7ebf\u5b89\u88c5\u7684\u65b9\u5f0f\uff0c\u5b83\u4f1a\u4ece\u9ed8\u8ba4\u7684\u7f51\u4e0a\u5730\u5740\u6765\u5bfb\u627e\u8f6f\u4ef6\u5305\uff0c\u7136\u540e\u81ea\u52a8\u5b8c\u6210\u4e00\u7cfb\u5217\u8fc7\u7a0b\u3002\u7136\u800c\u5f53\u6211\u4eec\u6ca1\u6709\u7f51\u7edc\u7684\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5c31\u9700\u8981\u642d\u5efa\u81ea\u5df1\u672c\u5730\u7684Yum\u6e90\u3002\u4eca\u5929\u5c71\u533b\u7684\u5c0f\u51e1\u5c31\u624b\u628a\u624b\u5e26\u4f60\u642d\u5efa\u672c\u5730\u7684\u5149\u76d8Yum\u6e90\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"yum\"<\/p>\n

1.\u865a\u62df\u673a\u7684\u8bbe\u7f6e<\/strong><\/div>\n

\"\u865a\u62df\u673a\"
\n\u6ce8\u610f\u786c\u4ef6\u4f7f\u7528ISO\u6620\u50cf\u6587\u4ef6\uff0c\u8bbe\u5907\u5904\u4e8e\u5df2\u8fde\u63a5\u72b6\u6001\u3002<\/p>\n

2.\u6302\u8f7dCD\u5149\u76d8<\/strong><\/div>\n
\r\n[root@nft_server ~]# mkdir \/mnt\/cdrom\r\n[root@nft_server ~]# mount -o loop \/dev\/cdrom \/mnt\/cdrom\r\n[root@nft_server ~]# ls -l \/mnt\r\n\u603b\u7528\u91cf 4\r\ndr-xr-xr-x. 7 root root 4096 3\u6708 6 2013 cdrom\r\n<\/pre>\n

\u8ddf\u7740\u5c71\u533b\u7684\u5c0f\u51e1\uff0c\u624b\u628a\u624b\u6572\u547d\u4ee4\u3002\u5728mnt\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2acdrom\u76ee\u5f55\u4f5c\u4e3a\u6302\u8f7d\u70b9\uff0c\u628a\u5149\u76d8\u6302\u8f7d\u5728\u6b64\u5904\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u8bbf\u95ee\u7684\u5165\u53e3\u3002<\/p>\n

3.\u8ba9\u7f51\u7edcyum\u6e90\u5931\u6548<\/strong><\/div>\n
\r\n[root@nft_server ~]# cd \/etc\/yum.repos.d\/\r\n[root@nft_server yum.repos.d]# ls\r\nCentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo  CentOS-Vault.repo\r\n[root@nft_server yum.repos.d]# mkdir repo.dir\r\n[root@nft_server yum.repos.d]# mv Centos* .\/repo.dir\r\n[root@nft_server yum.repos.d]# mv CentOS* .\/repo.dir\r\n[root@nft_server yum.repos.d]# ls\r\nrepo.dir\r\n<\/pre>\n

\u6b64\u5904\u8ba9\u7f51\u7edcyum\u6e90\u5931\u6548\u7684\u65b9\u5f0f\u5c31\u662f\u5c06\u5176\u914d\u7f6e\u6587\u4ef6\u79fb\u52a8\u5230\u6211\u521b\u5efa\u7684repo.dir\u76ee\u5f55\u4e0b\uff0c\u8fd9\u6837\u5728\u4f7f\u7528yum\u5de5\u5177\u65f6\uff0c\u5c31\u8bfb\u53d6\u4e0d\u5230\u7f51\u7edcyum\u6e90\u7684\u5730\u5740\u3002<\/p>\n

3.\u521b\u5efa\u5e76\u914d\u7f6e\u672c\u5730\u7684yum\u6e90\u6587\u4ef6<\/strong><\/div>\n
\r\n[root@nft_server yum.repos.d]# touch chenfan.repo\r\n[root@nft_server yum.repos.d]# vim chenfan.repo\r\n[root@nft_server yum.repos.d]# cat chenfan.repo\r\n#############by chenfan 2016\/5\/14\r\n[chenfan]\r\nname=chenfan\r\nbaseurl=file:\/\/\/mnt\/cdrom\r\ngpgcheck=0\r\nenabled=1\r\n#########by chenfan 2016\/5\/28\r\n<\/pre>\n

\u4e3b\u8981\u901a\u8fc7\u521b\u5efa\u4ee5.repo\u7ed3\u5c3e\u7684\u6587\u4ef6\uff0c\u7136\u540e\u5728\u6587\u4ef6\u91cc\u9762\u589e\u52a0\u4e0a\u8ff0\u7684\u5185\u5bb9\uff0c\u6ce8\u610f\u6b64\u5904\u7684baseurl\u4e3a\u6302\u8f7d\u70b9\u8def\u5f84\uff01<\/p>\n

4.\u68c0\u9a8c\u672c\u5730yum\u6e90\u662f\u5426\u914d\u7f6e\u6b63\u786e<\/strong><\/div>\n
\r\n[root@nft_server yum.repos.d]# yum install tree -y\r\nLoaded plugins: fastestmirror, security\r\nLoading mirror speeds from cached hostfile\r\nchenfan                                                  | 4.0 kB     00:00 ...\r\nchenfan\/primary_db                                       | 4.4 MB     00:00 ...\r\nSetting up Install Process\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package tree.x86_64 0:1.5.3-2.el6 will be installed\r\n--> Finished Dependency Resolution\r\nDependencies Resolved\r\n========================================================================================================================================================================\r\n Package                              Arch                                   Version                                      Repository                               Size\r\n========================================================================================================================================================================\r\nInstalling:\r\n tree                                 x86_64                                 1.5.3-2.el6                                  chenfan                                  36 k\r\n\r\nTransaction Summary\r\n========================================================================================================================================================================\r\nInstall       1 Package(s)\r\nTotal download size: 36 k\r\nInstalled size: 65 k\r\nDownloading Packages:\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing : tree-1.5.3-2.el6.x86_64                                                                                                                              1\/1\r\n  Verifying  : tree-1.5.3-2.el6.x86_64                                                                                                                              1\/1\r\n\r\nInstalled:\r\n  tree.x86_64 0:1.5.3-2.el6\r\n\r\nComplete!\r\n<\/pre>\n

\u6b64\u5904\u4e3b\u8981\u901a\u8fc7\u5b89\u88c5tree\u5305\u6765\u68c0\u67e5\u672c\u5730yum\u6e90\u662f\u5426\u914d\u7f6e\u6b63\u786e\uff0c\u8ddf\u7740\u5c0f\u51e1\u5b66linux\uff0c\u7b80\u5355\u800c\u76f4\u63a5\uff01<\/p>\n

\u672c\u6587\u539f\u521b\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/cd-yum-source.html<\/a>\u4f5c\u8005\uff1a\u9648\u51e1\uff0c\u5ba1\u6838\u5458\uff1a\u51af\u632f\u534e<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u5f53\u6211\u4eec\u5728\u4f7f\u7528Yum\u5de5\u5177\u5b89\u88c5\u8f6f\u4ef6\u5305\u65f6\uff0c\u6211\u4eec\u4f1a\u611f\u89c9\u975e\u5e38\u7b80\u5355\uff0c\u5b83\u89e3\u51b3\u4e86\u4e00\u5b9a\u7a0b\u5ea6\u8f6f\u4ef6\u5305\u7684\u4f9d\u8d56\u5173\u7cfb\u3002\u4f46\u662fYum\u5de5\u5177 […]<\/p>\n","protected":false},"author":63,"featured_media":14300,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-14241","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\/14241","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=14241"}],"version-history":[{"count":19,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/14241\/revisions"}],"predecessor-version":[{"id":253999,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/14241\/revisions\/253999"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/14300"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=14241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=14241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=14241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}