{"id":297,"date":"2019-03-19T22:55:07","date_gmt":"2019-03-19T14:55:07","guid":{"rendered":"https:\/\/qtvz.com\/?p=297"},"modified":"2019-03-19T22:55:07","modified_gmt":"2019-03-19T14:55:07","slug":"centos7%e7%b3%bb%e7%bb%9f%e9%85%8d%e7%bd%ae%e5%9b%bd%e5%86%85yum%e6%ba%90%e5%92%8cepel%e6%ba%90","status":"publish","type":"post","link":"https:\/\/qtvz.com\/297.html","title":{"rendered":"CentOS7\u7cfb\u7edf\u914d\u7f6e\u56fd\u5185yum\u6e90\u548cepel\u6e90"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression-->\n<h3 id=\"\u9996\u5148\u8fdb\u5165etcyum.repos.d\u76ee\u5f55\u4e0b\u65b0\u5efa\u4e00\u4e2arepo_bak\u76ee\u5f55\u7528\u4e8e\u4fdd\u5b58\u7cfb\u7edf\u4e2d\u539f\u6765\u7684repo\u6587\u4ef6\">1.\u9996\u5148\u8fdb\u5165<code>\/etc\/yum.repos.d\/<\/code>\u76ee\u5f55\u4e0b\uff0c\u65b0\u5efa\u4e00\u4e2arepo_bak\u76ee\u5f55\uff0c\u7528\u4e8e\u4fdd\u5b58\u7cfb\u7edf\u4e2d\u539f\u6765\u7684repo\u6587\u4ef6<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>[root@bogon ~]# cd \/etc\/yum.repos.d\/\n\n[root@bogon yum.repos.d]# mkdir repo_bak\n\n[root@bogon yum.repos.d]# mv *.repo repo_bak\/<\/code><\/pre>\n\n\n\n<h3 id=\"\u5728centos\u4e2d\u914d\u7f6e\u4f7f\u7528\u7f51\u6613\u548c\u963f\u91cc\u7684\u5f00\u6e90\u955c\u50cf\">2.\u5728CentOS\u4e2d\u914d\u7f6e\u4f7f\u7528\u7f51\u6613\u548c\u963f\u91cc\u7684\u5f00\u6e90\u955c\u50cf<\/h3>\n\n\n\n<p>\u5230\u7f51\u6613\u548c\u963f\u91cc\u5f00\u6e90\u955c\u50cf\u7ad9\u70b9\u4e0b\u8f7d\u7cfb\u7edf\u5bf9\u5e94\u7248\u672c\u7684repo\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[root@bogon yum.repos.d]# wget http:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo\n\n[root@bogon yum.repos.d]# wget http:\/\/mirrors.163.com\/.help\/CentOS7-Base-163.repo\n\n[root@bogon yum.repos.d]# ls\nCentos-7.repo  CentOS-Base-163.repo  repo.bak<\/code><\/pre>\n\n\n\n<p>\u6216\u8005\u624b\u52a8\u4e0b\u8f7drepo\u6587\u4ef6\u5e76\u4e0a\u4f20\u5230<code>\/etc\/yum.repos.d\/<\/code>\u76ee\u5f55<\/p>\n\n\n\n<p><a href=\"https:\/\/qtvz.com\/redirect\/aHR0cDovL21pcnJvcnMuMTYzLmNvbS8uaGVscC9jZW50b3MuaHRtbA==\" target=\"_blank\">\u7f51\u6613\u5f00\u6e90\u955c\u50cf\u7ad9<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/qtvz.com\/redirect\/aHR0cHM6Ly9vcHN4LmFsaWJhYmEuY29tL21pcnJvcj9sYW5nPXpoLWNu\" target=\"_blank\">\u963f\u91cc\u5f00\u6e90\u955c\u50cf\u7ad9<\/a><\/p>\n\n\n\n<h3 id=\"\u6e05\u9664\u7cfb\u7edfyum\u7f13\u5b58\u5e76\u751f\u6210\u65b0\u7684yum\u7f13\u5b58\">3.\u6e05\u9664\u7cfb\u7edfyum\u7f13\u5b58\u5e76\u751f\u6210\u65b0\u7684yum\u7f13\u5b58<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>[root@bogon yum.repos.d]# ls        # \u5217\u51fa\/etc\/yum.repos.d\/\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\nCentos-7.repo  CentOS-Base-163.repo  repo.bak\n\n[root@bogon yum.repos.d]# yum clean all     # \u6e05\u9664\u7cfb\u7edf\u6240\u6709\u7684yum\u7f13\u5b58\nLoaded plugins: fastestmirror, langpacks\nRepository base is listed more than once in the configuration\nRepository updates is listed more than once in the configuration\nRepository extras is listed more than once in the configuration\nRepository centosplus is listed more than once in the configuration\nCleaning repos: base extras updates\nCleaning up everything\nCleaning up list of fastest mirrors\n\n[root@bogon yum.repos.d]# yum makecache     # \u751f\u6210yum\u7f13\u5b58\nLoaded plugins: fastestmirror, langpacks\nRepository base is listed more than once in the configuration\nRepository updates is listed more than once in the configuration\nRepository extras is listed more than once in the configuration\nRepository centosplus is listed more than once in the configuration\nbase                                                                                  | 3.6 kB  00:00:00     \nextras                                                                                | 3.4 kB  00:00:00     \nupdates                                                                               | 3.4 kB  00:00:00     \n(1\/12): base\/7\/x86_64\/filelists_db                                                    | 6.7 MB  00:00:02     \n(2\/12): base\/7\/x86_64\/group_gz                                                        | 156 kB  00:00:02     \n(3\/12): base\/7\/x86_64\/other_db                                                        | 2.5 MB  00:00:01     \n(4\/12): base\/7\/x86_64\/primary_db                                                      | 5.7 MB  00:00:02     \n(5\/12): extras\/7\/x86_64\/prestodelta                                                   |  51 kB  00:00:01     \n(6\/12): extras\/7\/x86_64\/filelists_db                                                  | 494 kB  00:00:02     \n(7\/12): extras\/7\/x86_64\/other_db                                                      |  86 kB  00:00:00     \n(8\/12): extras\/7\/x86_64\/primary_db                                                    | 130 kB  00:00:01     \n(9\/12): updates\/7\/x86_64\/prestodelta                                                  | 406 kB  00:00:01     \n(10\/12): updates\/7\/x86_64\/filelists_db                                                | 2.1 MB  00:00:01     \n(11\/12): updates\/7\/x86_64\/other_db                                                    | 354 kB  00:00:00     \n(12\/12): updates\/7\/x86_64\/primary_db                                                  | 3.6 MB  00:00:01     \nDetermining fastest mirrors\nMetadata Cache Created<\/code><\/pre>\n\n\n\n<h3 id=\"\u5b89\u88c5epel\u6e90\">4.\u5b89\u88c5<a href=\"https:\/\/qtvz.com\/tag\/epel%e6%ba%90\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e epel\u6e90 \u7684\u6587\u7ae0\" target=\"_blank\">epel\u6e90<\/a><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>[root@bogon yum.repos.d]# yum list | grep epel-release\nRepository base is listed more than once in the configuration\nRepository updates is listed more than once in the configuration\nRepository extras is listed more than once in the configuration\nRepository centosplus is listed more than once in the configuration\nepel-release.noarch                         7-9                        extras   \n\n[root@bogon yum.repos.d]# yum install -y epel-release\nLoaded plugins: fastestmirror, langpacks\nRepository base is listed more than once in the configuration\nRepository updates is listed more than once in the configuration\nRepository extras is listed more than once in the configuration\nRepository centosplus is listed more than once in the configuration\nLoading mirror speeds from cached hostfile\nResolving Dependencies\n--> Running transaction check\n---> Package epel-release.noarch 0:7-9 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n=============================================================================================================\n Package                       Arch                    Version                 Repository               Size\n=============================================================================================================\nInstalling:\n epel-release                  noarch                  7-9                     extras                   14 k\n\nTransaction Summary\n=============================================================================================================\nInstall  1 Package\n\nTotal download size: 14 k\nInstalled size: 24 k\nDownloading packages:\nepel-release-7-9.noarch.rpm                                                           |  14 kB  00:00:00     \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n  Installing : epel-release-7-9.noarch                                                                   1\/1 \n  Verifying  : epel-release-7-9.noarch                                                                   1\/1 \n\nInstalled:\n  epel-release.noarch 0:7-9                                                                                  \n\nComplete!\n[root@bogon yum.repos.d]# ls            # <a href=\"https:\/\/qtvz.com\/tag\/epel%e6%ba%90\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e epel\u6e90 \u7684\u6587\u7ae0\" target=\"_blank\">epel\u6e90<\/a>\u5b89\u88c5\u6210\u529f\uff0c\u6bd4\u539f\u6765\u591a\u4e86\u4e00\u4e2aepel.repo\u548cepel-testing.repo\u6587\u4ef6\nCentos-7.repo  CentOS-Base-163.repo  epel.repo  epel-testing.repo  repo.bak<\/code><\/pre>\n\n\n\n<h3 id=\"\u4f7f\u7528\u963f\u91cc\u5f00\u6e90\u955c\u50cf\u63d0\u4f9b\u7684epel\u6e90\">5.\u4f7f\u7528\u963f\u91cc\u5f00\u6e90\u955c\u50cf\u63d0\u4f9b\u7684<a href=\"https:\/\/qtvz.com\/tag\/epel%e6%ba%90\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e epel\u6e90 \u7684\u6587\u7ae0\" target=\"_blank\">epel\u6e90<\/a><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>[root@bogon yum.repos.d]# wget -O \/etc\/yum.repos.d\/epel-7.repo http:\/\/mirrors.aliyun.com\/repo\/epel-7.repo    # \u4e0b\u8f7d\u963f\u91cc\u5f00\u6e90\u955c\u50cf\u7684epel\u6e90\u6587\u4ef6\n--2018-03-08 20:22:14--  http:\/\/mirrors.aliyun.com\/repo\/epel-7.repo\nResolving mirrors.aliyun.com (mirrors.aliyun.com)... 183.2.199.237, 113.96.109.95, 113.96.109.93, ...\nConnecting to mirrors.aliyun.com (mirrors.aliyun.com)|183.2.199.237|:80... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 1084 (1.1K) [application\/octet-stream]\nSaving to: \u2018\/etc\/yum.repos.d\/epel-7.repo\u2019\n\n100%[=================================================================================================>] 1,084       --.-K\/s   in 0s      \n\n2018-03-08 20:22:14 (130 MB\/s) - \u2018\/etc\/yum.repos.d\/epel-7.repo\u2019 saved [1084\/1084]\n\n[root@bogon yum.repos.d]# ls\nCentOS7-Base-163.repo  Centos-7.repo  epel-7.repo  epel.repo  epel-testing.repo  repo_bak<\/code><\/pre>\n\n\n\n<h3 id=\"\u518d\u6b21\u6e05\u9664\u7cfb\u7edfyum\u7f13\u5b58\u5e76\u91cd\u65b0\u751f\u6210\u65b0\u7684yum\u7f13\u5b58\">6.\u518d\u6b21\u6e05\u9664\u7cfb\u7edfyum\u7f13\u5b58\uff0c\u5e76\u91cd\u65b0\u751f\u6210\u65b0\u7684yum\u7f13\u5b58<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>[root@bogon yum.repos.d]# yum clean all\nLoaded plugins: fastestmirror, langpacks\nRepository base is listed more than once in the configuration\nRepository updates is listed more than once in the configuration\nRepository extras is listed more than once in the configuration\nRepository centosplus is listed more than once in the configuration\nRepository epel is listed more than once in the configuration\nRepository epel-debuginfo is listed more than once in the configuration\nRepository epel-source is listed more than once in the configuration\nCleaning repos: base epel extras updates\nCleaning up everything\nCleaning up list of fastest mirrors\n\n[root@bogon yum.repos.d]# yum makecache\nLoaded plugins: fastestmirror, langpacks\nRepository base is listed more than once in the configuration\nRepository updates is listed more than once in the configuration\nRepository extras is listed more than once in the configuration\nRepository centosplus is listed more than once in the configuration\nRepository epel is listed more than once in the configuration\nRepository epel-debuginfo is listed more than once in the configuration\nRepository epel-source is listed more than once in the configuration\nbase                                                                                                                | 3.6 kB  00:00:00     \nepel                                                                                                                | 4.7 kB  00:00:00     \nextras                                                                                                              | 3.4 kB  00:00:00     \nupdates                                                                                                             | 3.4 kB  00:00:00     \n(1\/18): base\/7\/x86_64\/group_gz                                                                                      | 156 kB  00:00:01     \n(2\/18): base\/7\/x86_64\/filelists_db                                                                                  | 6.7 MB  00:00:07     \n(3\/18): base\/7\/x86_64\/primary_db                                                                                    | 5.7 MB  00:00:06     \n(4\/18): epel\/x86_64\/group_gz                                                                                        | 266 kB  00:00:01     \n(5\/18): epel\/x86_64\/updateinfo                                                                                      | 899 kB  00:00:02     \n(6\/18): epel\/x86_64\/prestodelta                                                                                     | 7.1 kB  00:00:00     \n(7\/18): base\/7\/x86_64\/other_db                                                                                      | 2.5 MB  00:00:05     \n(8\/18): epel\/x86_64\/primary_db                                                                                      | 6.3 MB  00:00:04     \n(9\/18): extras\/7\/x86_64\/filelists_db                                                                                | 636 kB  00:00:00     \n(10\/18): extras\/7\/x86_64\/primary_db                                                                                 | 166 kB  00:00:00     \n(11\/18): extras\/7\/x86_64\/other_db                                                                                   | 108 kB  00:00:00     \n(12\/18): extras\/7\/x86_64\/prestodelta                                                                                | 102 kB  00:00:01     \n(13\/18): epel\/x86_64\/other_db                                                                                       | 3.0 MB  00:00:01     \n(14\/18): epel\/x86_64\/filelists_db                                                                                   |  10 MB  00:00:09     \n(15\/18): updates\/7\/x86_64\/filelists_db                                                                              | 3.5 MB  00:00:02     \n(16\/18): updates\/7\/x86_64\/prestodelta                                                                               | 771 kB  00:00:02     \n(17\/18): updates\/7\/x86_64\/other_db                                                                                  | 621 kB  00:00:00     \n(18\/18): updates\/7\/x86_64\/primary_db                                                                                | 6.0 MB  00:00:03     \nDetermining fastest mirrors\n * epel: mirrors.aliyun.com\nMetadata Cache Created<\/code><\/pre>\n\n\n\n<h3 id=\"\u67e5\u770b\u7cfb\u7edf\u53ef\u7528\u7684yum\u6e90\u548c\u6240\u6709\u7684yum\u6e90\">7.\u67e5\u770b\u7cfb\u7edf\u53ef\u7528\u7684<a href=\"https:\/\/qtvz.com\/tag\/yum%e6%ba%90\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e yum\u6e90 \u7684\u6587\u7ae0\" target=\"_blank\">yum\u6e90<\/a>\u548c\u6240\u6709\u7684yum\u6e90<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>[root@bogon yum.repos.d]# yum repolist enabled\nLoaded plugins: fastestmirror, langpacks\nRepository base is listed more than once in the configuration\nRepository updates is listed more than once in the configuration\nRepository extras is listed more than once in the configuration\nRepository centosplus is listed more than once in the configuration\nRepository epel is listed more than once in the configuration\nRepository epel-debuginfo is listed more than once in the configuration\nRepository epel-source is listed more than once in the configuration\nLoading mirror speeds from cached hostfile\n * epel: mirrors.aliyun.com\nrepo id                                            repo name                                                                         status\nbase\/7\/x86_64                                      CentOS-7 - Base - 163.com                                                          9,591\nepel\/x86_64                                        Extra Packages for Enterprise Linux 7 - x86_64                                    12,382\nextras\/7\/x86_64                                    CentOS-7 - Extras - 163.com                                                          390\nupdates\/7\/x86_64                                   CentOS-7 - Updates - 163.com                                                       1,941\nrepolist: 24,304\n\n[root@bogon yum.repos.d]# yum repolist all\nLoaded plugins: fastestmirror, langpacks\nRepository base is listed more than once in the configuration\nRepository updates is listed more than once in the configuration\nRepository extras is listed more than once in the configuration\nRepository centosplus is listed more than once in the configuration\nRepository epel is listed more than once in the configuration\nRepository epel-debuginfo is listed more than once in the configuration\nRepository epel-source is listed more than once in the configuration\nLoading mirror speeds from cached hostfile\n * epel: mirrors.aliyun.com\nrepo id                                     repo name                                                                       status\nbase\/7\/x86_64                               CentOS-7 - Base - 163.com                                                       enabled:  9,591\ncentosplus\/7\/x86_64                         CentOS-7 - Plus - 163.com                                                       disabled\ncontrib\/7\/x86_64                            CentOS-7 - Contrib - mirrors.aliyun.com                                         disabled\nepel\/x86_64                                 Extra Packages for Enterprise Linux 7 - x86_64                                  enabled: 12,382\nepel-debuginfo\/x86_64                       Extra Packages for Enterprise Linux 7 - x86_64 - Debug                          disabled\nepel-source                                 Extra Packages for Enterprise Linux 7 - x86_64 - Source                         disabled\nepel-testing\/x86_64                         Extra Packages for Enterprise Linux 7 - Testing - x86_64                        disabled\nepel-testing-debuginfo\/x86_64               Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Debug                disabled\nepel-testing-source\/x86_64                  Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Source               disabled\nextras\/7\/x86_64                             CentOS-7 - Extras - 163.com                                                     enabled:    390\nupdates\/7\/x86_64                            CentOS-7 - Updates - 163.com                                                    enabled:  1,941\nrepolist: 24,304<\/code><\/pre>\n\n\n\n<p>\u539f\u6587:<a href=\"https:\/\/qtvz.com\/redirect\/aHR0cHM6Ly93d3cuY25ibG9ncy5jb20vcmVucGluZ3NoZW5nL3AvNzg0NTA5Ni5odG1s\" target=\"_blank\">https:\/\/www.cnblogs.com\/renpingsheng\/p\/7845096.html<\/a><\/p>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"1.\u9996\u5148\u8fdb\u5165\/etc\/yum.repos.d\/\u76ee\u5f55\u4e0b\uff0c\u65b0\u5efa\u4e00\u4e2arepo_bak\u76ee\u5f55\uff0c\u7528\u4e8e\u4fdd\u5b58\u7cfb\u7edf\u4e2d\u539f\u6765\u7684repo\u6587\u4ef6 2.\u5728CentOS\u4e2d\u914d\u7f6e\u4f7f\u7528\u7f51\u6613\u548c\u963f\u91cc\u7684\u5f00\u6e90\u955c\u50cf \u5230\u7f51\u6613\u548c\u963f\u91cc\u5f00\u6e90\u955c\u50cf\u7ad9\u70b9\u4e0b\u8f7d\u7cfb\u7edf \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[77],"tags":[79,78],"views":12263,"_links":{"self":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/297"}],"collection":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/comments?post=297"}],"version-history":[{"count":1,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/297\/revisions"}],"predecessor-version":[{"id":298,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/297\/revisions\/298"}],"wp:attachment":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/media?parent=297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/categories?post=297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/tags?post=297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}