{"id":681,"date":"2020-03-18T11:04:13","date_gmt":"2020-03-18T03:04:13","guid":{"rendered":"http:\/\/blog.ywdevops.cn\/?p=681"},"modified":"2023-06-15T09:43:40","modified_gmt":"2023-06-15T01:43:40","slug":"yum","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2020\/03\/18\/yum\/","title":{"rendered":"yum\u6e90\u672c\u5730\u4ed3\u5e93\u914d\u7f6e"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"> Yum \u8f6f\u4ef6\u4ed3\u5e93\u7684\u4f5c\u7528\u662f\u4e3a\u4e86\u8fdb\u4e00\u6b65\u7b80\u5316 RPM \u7ba1\u7406\u8f6f\u4ef6\u7684\u96be\u5ea6\u4ee5\u53ca\u81ea\u52a8\u5206\u6790 \u6240\u9700\u8f6f\u4ef6\u5305\u53ca\u5176\u4f9d\u8d56\u5173\u7cfb\u7684\u6280\u672f\u3002  \u53ef\u4ee5\u628a Yum \u60f3\u8c61\u6210\u662f\u4e00\u4e2a\u7855\u5927\u7684\u8f6f\u4ef6\u4ed3\u5e93\uff0c\u91cc\u9762\u4fdd\u5b58\u6709\u51e0\u4e4e\u6240 \u6709\u5e38\u7528\u7684\u5de5\u5177 \u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong> <\/strong>1\u3001\u8fdb\u5165\u5230<strong>\/etc\/yum.repos.d\/<\/strong>\u76ee\u5f55\u4e2d\uff08\u56e0\u4e3a\u8be5\u76ee\u5f55\u5b58\u653e\u7740 Yum \u8f6f\u4ef6\u4ed3\u5e93\u7684\u914d\u7f6e\u6587\u4ef6\uff09\u3002 <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> 2\u3001\u4f7f\u7528 Vim \u7f16\u8f91\u5668\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a rhel7.repo \u7684\u65b0\u914d\u7f6e\u6587\u4ef6\uff0c<strong>\u6ce8\u610f\u540e\u7f00\u540d\u5fc5\u987b\u4e3arepo<\/strong>\uff0c\u524d\u9762\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff0c\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u5199\u5165\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li> <strong>[rhel-media] \uff1a<\/strong>Yum \u8f6f\u4ef6\u4ed3\u5e93\u552f\u4e00\u6807\u8bc6\u7b26\uff0c\u907f\u514d\u4e0e\u5176\u4ed6\u4ed3\u5e93\u51b2\u7a81<\/li>\n\n\n\n<li> <strong>name=linux\uff1a<\/strong>Yum \u8f6f\u4ef6\u4ed3\u5e93\u7684\u540d\u79f0\u63cf\u8ff0\uff0c\u6613\u4e8e\u8bc6\u522b\u4ed3\u5e93\u7528\u5904\u3002<\/li>\n\n\n\n<li> <strong>baseurl=file:\/\/\/media\/cdrom<\/strong>\uff1a\u9664\u4e86file\u8fd8\u53ef\u4ee5\u4f7f\u7528ftp\/http  <\/li>\n\n\n\n<li> <strong>enabled=1\uff1a<\/strong>\u8bbe\u7f6e\u6b64\u6e90\u662f\u5426\u53ef\u7528\uff1b1 \u4e3a\u53ef\u7528\uff0c0 \u4e3a\u7981\u7528\u3002 <\/li>\n\n\n\n<li> <strong>gpgcheck=1\uff1a<\/strong>\u8bbe\u7f6e\u6b64\u6e90\u662f\u5426\u6821\u9a8c\u6587\u4ef6\uff1b1 \u4e3a\u6821\u9a8c\uff0c0 \u4e3a\u4e0d\u6821\u9a8c\u3002<\/li>\n\n\n\n<li><strong> gpgkey=file:\/\/\/media\/cdrom\/\u516c\u94a5\u5730\u5740<\/strong>\uff1a \u82e5\u5f00\u542f\u6821\u9a8c\u9700\u8981\u6307\u5b9a\u516c\u94a5\u5730\u5740<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"195\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/03\/11-6.png\" alt=\"\" class=\"wp-image-919\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/03\/11-6.png 550w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/03\/11-6-300x106.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;rhel-media]\nname=linux\nbaseurl=file:\/\/\/media\/cdrom\nenabled=1\ngpgcheck=0\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001\u6309\u914d\u7f6e\u53c2\u6570\u7684\u8def\u5f84\u6302\u8f7d\u5149\u76d8\uff0c\u5c06\u6302\u8f7d\u4fe1\u606f\u5199\u5165\u5230\/etc\/fstab \u6587\u4ef6\u4e2d\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li> <strong>mkdir -p \/media\/cdrom   <\/strong>\uff1a\u521b\u5efa\u6302\u8f7d\u76ee\u5f55<\/li>\n\n\n\n<li> <strong>mount \/dev\/cdrom \/media\/cdrom<\/strong>  \uff1a\u6302\u8f7d\u5149\u76d8\u955c\u50cf <\/li>\n\n\n\n<li> <strong>vim \/etc\/fstab<\/strong>  \u5199\u5165\u5230fstab\u4e2d \/dev\/cdrom \/media\/cdrom  iso9660 defaults 0 0  <\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001\u6e05\u695a\u7f13\u5b58\u5e76\u91cd\u65b0\u5236\u4f5c\u7f13\u5b58 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum clean all\nyum makecache<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">6\u3001\u4f7f\u7528\u201cyum install httpd -y\u201d\u547d\u4ee4\u68c0\u67e5 Yum \u8f6f\u4ef6\u4ed3\u5e93\u662f\u5426\u5df2\u7ecf\u53ef\u7528<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u81f3\u6b64YUM\u8f6f\u4ef6\u4ed3\u5e93\u914d\u7f6e\u5b8c\u6210\uff01\uff01\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yum \u8f6f\u4ef6\u4ed3\u5e93\u7684\u4f5c\u7528\u662f\u4e3a\u4e86\u8fdb\u4e00\u6b65\u7b80\u5316 RPM \u7ba1\u7406\u8f6f\u4ef6\u7684\u96be\u5ea6\u4ee5\u53ca\u81ea\u52a8\u5206\u6790 \u6240\u9700\u8f6f\u4ef6\u5305\u53ca\u5176\u4f9d\u8d56\u5173\u7cfb\u7684\u6280\u672f\u3002 \u53ef [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":685,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,22],"tags":[74],"class_list":["post-681","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-server","tag-yum"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=681"}],"version-history":[{"count":9,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/681\/revisions"}],"predecessor-version":[{"id":13564,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/681\/revisions\/13564"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/685"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}