{"id":390,"date":"2015-01-09T19:49:04","date_gmt":"2015-01-09T19:49:04","guid":{"rendered":"http:\/\/a01a0380ca3c61428c26a231f0e49a09"},"modified":"2019-05-17T19:37:19","modified_gmt":"2019-05-17T11:37:19","slug":"redhat-yum","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/390","title":{"rendered":"RedHat Yum &#038; Yum Update &#038; EPEL"},"content":{"rendered":"<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">yum install epel-release<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">Redhat Linux\u901a\u5e38\u7531\u4e8e\u6ca1\u6709\u6ce8\u518c\uff0c\u5bfc\u81f4yum\u7a0b\u5e8f\u65e0\u6cd5\u4f7f\u7528\uff0c\u9700\u8981\u5c06\u5176\u66ff\u6362\u4e3acentos\u7684yum\u7a0b\u5e8f\u3002<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">1. \u4e0b\u8f7dYum\u7684\u5b89\u88c5\u5305,\u7531\u4e8e\u4f53\u7cfb\u7ed3\u6784\u7684\u4e0d\u540c\u548c\u5305\u7684\u66f4\u65b0\uff0c\u56e0\u6b64\u76ee\u5f55\u548c\u6587\u4ef6\u540d\u7684\u7248\u672c\u53f7\u53ef\u80fd\u9700\u8981\u8c03\u6574\u4ee5\u4e0b\u3002<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">#wget<span class=\"Apple-converted-space\">\u00a0<\/span><a style=\"color: #78afd3; text-decoration: underline;\" href=\"http:\/\/centos.ustc.edu.cn\/centos\/5\/os\/i386\/CentOS\/yum-3.2.22-33.el5.centos.noarch.rpm\">http:\/\/centos.ustc.edu.cn\/centos\/5\/os\/{i386|x86_64}\/CentOS\/yum-3.2.22-39.el5.centos.noarch.rpm<\/a><br \/>\n#wget<span class=\"Apple-converted-space\">\u00a0<\/span><a style=\"color: #78afd3; text-decoration: underline;\" href=\"http:\/\/centos.ustc.edu.cn\/centos\/5\/os\/i386\/CentOS\/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm\">http:\/\/centos.ustc.edu.cn\/centos\/5\/os\/{i386|x86_64}\/CentOS\/yum-fastestmirror-1.1.16-21.el5.centos.1.noarch.rpm<\/a><br \/>\n#wget<span class=\"Apple-converted-space\">\u00a0<\/span><a style=\"color: #78afd3; text-decoration: underline;\" href=\"http:\/\/centos.ustc.edu.cn\/centos\/5\/os\/i386\/CentOS\/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm\">http:\/\/centos.ustc.edu.cn\/centos\/5\/os\/{i386|x86_64}\/CentOS\/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm<\/a><\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">2. \u67e5\u51fa\u5f53\u524d\u7684yum\u7a0b\u5e8f\uff0c\u8fdb\u884c\u5378\u8f7d<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">#rpm -qa|grep yum<br \/>\n# rpm -e yum-3.2.22-20.el5 --nodeps<br \/>\n# rpm -e yum-updatesd-0.9-2.el5 --nodeps<br \/>\n# rpm -e yum-security-1.1.16-13.el5 --nodeps<br \/>\n# rpm -e yum-metadata-parser-1.1.2-3.el5 --nodeps<br \/>\n# rpm -e yum-rhn-plugin-0.5.4-13.el5 --nodeps<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">3. \u4e0b\u8f7d\u5e76\u5bfc\u5165KEY<br \/>\n# cd \/etc\/pki\/rpm-gpg\/<br \/>\n# wget<span class=\"Apple-converted-space\">\u00a0<\/span><a style=\"color: #78afd3; text-decoration: underline;\" href=\"http:\/\/mirrors.sohu.com\/centos\/RPM-GPG-KEY-CentOS-5\">http:\/\/mirrors.sohu.com\/centos\/RPM-GPG-KEY-CentOS-5<\/a><br \/>\n# rpm --import \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY*<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">4. \u5b89\u88c5yum\u5b89\u88c5\u5305<br \/>\nrpm -ivh yum-3.2.22-39.el5.centos.noarch.rpm \\<br \/>\nyum-fastestmirror-1.1.16-21.el5.centos.1.noarch.rpm \\<br \/>\nyum-metadata-parser-1.1.2-3.el5.centos.i386.rpm<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">5. \u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">Vi \/etc\/yum.repos.d\/rhel-debuginfo.repo<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">[base]<br \/>\nname=Red Hat Enterprise Linux $releasever -Base<br \/>\nbaseurl=http:\/\/mirrors.sohu.com\/centos\/5.5\/os\/$basearch\/<br \/>\ngpgcheck=1<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">[update]<br \/>\nname=Red Hat Enterprise Linux $releasever -Updates<br \/>\nbaseurl=http:\/\/mirrors.sohu.com\/centos\/5.5\/updates\/$basearch\/<br \/>\ngpgcheck=1<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">[extras]<br \/>\nname=Red Hat Enterprise Linux $releasever -Extras<br \/>\nbaseurl=http:\/\/mirrors.sohu.com\/centos\/5.5\/extras\/$basearch\/<br \/>\ngpgcheck=1<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">[addons]<br \/>\nname=Red Hat Enterprise Linux $releasever -Addons<br \/>\nbaseurl=http:\/\/mirrors.sohu.com\/centos\/5.5\/addons\/$basearch\/<br \/>\ngpgcheck=1<\/p>\n<p style=\"text-transform: none; background-color: #ffffff; text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px\/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; color: #000000; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">\u81f3\u6b64yum\u5b89\u88c5\u5b8c\u6210\uff0c\u53ef\u4ee5 yum install \u5b89\u88c5\u7a0b\u5e8f<\/p>\n<h6>###########################################<\/h6>\n<p data-spm-anchor-id=\"0.0.0.i4.5c3fc8ebfEIpYc\">CentOS 7 repo<\/p>\n<p>curl -o \/etc\/yum.repos.d\/CentOS-Base.repo http:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo<br \/>\nwget -O \/etc\/yum.repos.d\/CentOS-Base.repo http:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo<\/p>\n<p data-spm-anchor-id=\"0.0.0.i4.5c3fc8ebfEIpYc\">yum clean all<br \/>\nyum makecache<\/p>\n<p>######################################<\/p>\n<h1 class=\"aTitle\">yum update<\/h1>\n<p>RedHat\/CentOS\/Fedora\u4f7f\u7528\u00a0 yum update\u00a0 \u66f4\u65b0\u65f6\u9ed8\u8ba4\u4f1a\u90fd\u4f1a\u5347\u7ea7\u5185\u6838\uff0c\u6bd4\u5982\u4eceCENTOS6.8\u5347\u7ea7\u5230CENTOS6.9\uff0c\u7ed3\u679c\u53ef\u80fd\u5bfc\u81f4php5.2\u7b49\u65e0\u6cd5\u4f7f\u7528\uff1b\u6709\u4e9b\u670d\u52a1\u5668\u786c\u4ef6\uff08\u7279\u522b\u662f\u7ec4\u88c5\u7684\u673a\u5668\uff09\u5728\u5347\u7ea7\u5185\u6838\u540e\uff0c\u65b0\u7684\u5185\u6838\u53ef\u80fd\u4e5f\u4f1a\u8ba4\u4e0d\u51fa\u67d0\u4e9b\u786c\u4ef6\uff0c\u8981\u91cd\u65b0\u5b89\u88c5\u9a71\u52a8\uff0c\u5f88\u9ebb\u70e6\u3002\u6240\u4ee5\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u4e0d\u8981\u8f7b\u6613\u7684\u5347\u7ea7\u5185\u6838\uff0c\u9664\u975e\u4f60\u786e\u5b9a\u5347\u7ea7\u5185\u6838\u540e\u4e0d\u4f1a\u51fa\u73b0\u9ebb\u70e6\u7684\u95ee\u9898\u3002<\/p>\n<p>\u4e0d\u5347\u7ea7\u5185\u6838\u65b9\u6cd5\uff1a<\/p>\n<p>\u5728 \/etc\/yum.conf \u7684 [main] \u540e\u9762\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\u5373\u53ef\uff01<\/p>\n<div class=\"container\">\n<div>exclude=kernel*<\/div>\n<div class=\"line number2 index1 alt1\">exclude=centos-release*<\/div>\n<div>\n<p>#################################<\/p>\n<h1 class=\"aTitle\">EPEL<\/h1>\n<p>-bit.edu.cn<br \/>\nrpm -ivh http:\/\/mirror.bit.edu.cn\/fedora\/epel\/epel-release-latest-6.noarch.rpm<br \/>\nrpm -ivh http:\/\/mirror.bit.edu.cn\/fedora\/epel\/epel-release-latest-7.noarch.rpm<br \/>\nyum repolist<\/p>\n<p>-\u5b98\u65b9\u6e90\u76f4\u63a5\u5b89\u88c5<\/p>\n<p>CentOS\/RHEL 5:<br \/>\nrpm -Uvh https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-5.noarch.rpm<\/p>\n<p>CentOS\/RHEL 6:<br \/>\nrpm -Uvh https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-6.noarch.rpm<\/p>\n<p>CentOS\/RHEL 7:<br \/>\nrpm -Uvh https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm<\/p>\n<p>-\u624b\u52a8\u963f\u91cc\u5b89\u88c5<br \/>\n1\u3001\u5907\u4efd(\u5982\u6709\u914d\u7f6e\u5176\u4ed6epel\u6e90)<br \/>\nmv \/etc\/yum.repos.d\/epel.repo \/etc\/yum.repos.d\/epel.repo.backup<br \/>\nmv \/etc\/yum.repos.d\/epel-testing.repo \/etc\/yum.repos.d\/epel-testing.repo.backup<\/p>\n<p>2\u3001\u4e0b\u8f7d\u65b0repo \u5230\/etc\/yum.repos.d\/<\/p>\n<p>epel(RHEL 7)<br \/>\nwget -O \/etc\/yum.repos.d\/epel.repo http:\/\/mirrors.aliyun.com\/repo\/epel-7.repo<\/p>\n<p>epel(RHEL 6)<br \/>\nwget -O \/etc\/yum.repos.d\/epel.repo http:\/\/mirrors.aliyun.com\/repo\/epel-6.repo<\/p>\n<p>epel(RHEL 5)<br \/>\nwget -O \/etc\/yum.repos.d\/epel.repo http:\/\/mirrors.aliyun.com\/repo\/epel-5.repo<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p style=\"text-transform:none;background-color:#ffffff;text-indent:0px;margin:10px auto;letter-spacing:normal;font:14px\/21px 'black Verdana', Arial, Helvetica, sans-serif;white-space:normal;color:#000000;word-spacing:0px;-webkit-text-stroke-width:0px;\">Redhat Linux\u901a\u5e38\u7531\u4e8e\u6ca1\u6709\u6ce8\u518c\uff0c\u5bfc\u81f4yum\u7a0b\u5e8f\u65e0\u6cd5\u4f7f\u7528\uff0c\u9700\u8981\u5c06\u5176\u66ff\u6362\u4e3acentos\u7684yum\u7a0b\u5e8f\u3002<\/p>\n<p style=\"text-transform:none;background-color:#ffffff;text-indent:0px;margin:10px auto;letter-spacing:normal;font:14px\/21px 'black Verdana', Arial, Helvetica, sans-serif;white-space:normal;color:#000000;word-spacing:0px;-webkit-text-stroke-width:0px;\">1. \u4e0b\u8f7dYum\u7684\u5b89\u88c5\u5305,\u7531\u4e8e\u4f53\u7cfb\u7ed3\u6784\u7684\u4e0d\u540c\u548c\u5305\u7684\u66f4\u65b0\uff0c\u56e0\u6b64\u76ee\u5f55\u548c\u6587\u4ef6\u540d\u7684\u7248\u672c\u53f7\u53ef\u80fd\u9700\u8981\u8c03\u6574\u4ee5\u4e0b\u3002<\/p>\n<p style=\"text-transform:none;background-color:#ffffff;text-indent:0px;margin:10px auto;letter-spacing:normal;font:14px\/21px 'black Verdana', Arial, Helvetica, sans-serif;white-space:normal;color:#000000;word-spacing:0px;-webkit-text-stroke-width:0px;\">#wget<span class=\"Apple-converted-space\">&nbsp;<\/span><a style=\"color:#78afd3;text-decoration:underline;\" href=\"http:\/\/centos.ustc.edu.cn\/centos\/5\/os\/i386\/CentOS\/yum-3.2.22-33.el5.centos.noarch.rpm\">http:\/\/centos.ustc.edu.cn\/centos\/5\/os\/{i386|x86_64}\/CentOS\/yum-3.2.22-39.el5.centos.noarch.rpm<\/a><br \/>\n#wget<span class=\"Apple-converted-space\">&nbsp;<\/span><a style=\"color:#78afd3;text-decoration:underline;\" href=\"http:\/\/centos.ustc.edu.cn\/centos\/5\/os\/i386\/CentOS\/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm\">http:\/\/centos.ustc.edu.cn\/centos\/5\/os\/{i386|x86_64}\/CentOS\/yum-fastestmirror-1.1...<\/a><\/p>\n<p> <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/390\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[287],"tags":[83,182],"class_list":["post-390","post","type-post","status-publish","format-standard","hentry","category-linux","tag-RedHat","tag-yum"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=390"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/390\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}