{"id":44410,"date":"2024-10-06T15:25:17","date_gmt":"2024-10-06T07:25:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/44410\/"},"modified":"2024-10-06T15:25:17","modified_gmt":"2024-10-06T07:25:17","slug":"linux-centos-7-%e5%8d%87%e7%b4%9a%e5%85%a7%e6%a0%b8%e5%85%b7%e9%ab%94%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/44410\/","title":{"rendered":"Linux CentOS 7 \u5347\u7d1a\u5167\u6838\u5177\u9ad4\u65b9\u6cd5"},"content":{"rendered":"<h1 id=\"linux-centos-7-%e5%8d%87%e7%b4%9a%e5%85%a7%e6%a0%b8%e5%85%b7%e9%ab%94%e6%96%b9%e6%b3%95-EcErYllOyi\">Linux CentOS 7 \u5347\u7d1a\u5167\u6838\u5177\u9ad4\u65b9\u6cd5<\/h1>\n<p>\u5728\u4f7f\u7528 Linux \u7cfb\u7d71\u7684\u904e\u7a0b\u4e2d\uff0c\u5167\u6838\u7684\u5347\u7d1a\u662f\u7dad\u6301\u7cfb\u7d71\u5b89\u5168\u6027\u548c\u6027\u80fd\u7684\u91cd\u8981\u6b65\u9a5f\u3002CentOS 7 \u4f5c\u70ba\u4e00\u500b\u7a69\u5b9a\u4e14\u5ee3\u6cdb\u4f7f\u7528\u7684 Linux \u767c\u884c\u7248\uff0c\u63d0\u4f9b\u4e86\u591a\u7a2e\u65b9\u6cd5\u4f86\u5347\u7d1a\u5167\u6838\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39\u5728 CentOS 7 \u4e2d\u5347\u7d1a\u5167\u6838\u7684\u5177\u9ad4\u65b9\u6cd5\uff0c\u5e6b\u52a9\u7528\u6236\u66f4\u597d\u5730\u7ba1\u7406\u5176\u4f3a\u670d\u5668\u3002<\/p>\n<h2 id=\"%e7%82%ba%e4%bb%80%e9%ba%bc%e9%9c%80%e8%a6%81%e5%8d%87%e7%b4%9a%e5%85%a7%e6%a0%b8%ef%bc%9f-EcErYllOyi\">\u70ba\u4ec0\u9ebc\u9700\u8981\u5347\u7d1a\u5167\u6838\uff1f<\/h2>\n<p>\u5167\u6838\u662f\u64cd\u4f5c\u7cfb\u7d71\u7684\u6838\u5fc3\uff0c\u8ca0\u8cac\u7ba1\u7406\u786c\u9ad4\u8cc7\u6e90\u548c\u63d0\u4f9b\u7cfb\u7d71\u670d\u52d9\u3002\u5347\u7d1a\u5167\u6838\u7684\u539f\u56e0\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u5b89\u5168\u6027\uff1a\u65b0\u7248\u672c\u7684\u5167\u6838\u901a\u5e38\u4fee\u5fa9\u4e86\u5df2\u77e5\u7684\u5b89\u5168\u6f0f\u6d1e\u3002<\/li>\n<li>\u6027\u80fd\uff1a\u5167\u6838\u5347\u7d1a\u53ef\u80fd\u5e36\u4f86\u6027\u80fd\u6539\u9032\uff0c\u7279\u5225\u662f\u5728\u8655\u7406\u5668\u548c\u8a18\u61b6\u9ad4\u7ba1\u7406\u65b9\u9762\u3002<\/li>\n<li>\u786c\u9ad4\u652f\u6301\uff1a\u65b0\u7248\u672c\u7684\u5167\u6838\u53ef\u80fd\u652f\u6301\u66f4\u65b0\u7684\u786c\u9ad4\u8a2d\u5099\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%aa%a2%e6%9f%a5%e7%95%b6%e5%89%8d%e5%85%a7%e6%a0%b8%e7%89%88%e6%9c%ac-EcErYllOyi\">\u6aa2\u67e5\u7576\u524d\u5167\u6838\u7248\u672c<\/h2>\n<p>\u5728\u5347\u7d1a\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u6aa2\u67e5\u7576\u524d\u7684\u5167\u6838\u7248\u672c\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>uname -r<\/code><\/pre>\n<h2 id=\"%e5%8d%87%e7%b4%9a%e5%85%a7%e6%a0%b8%e7%9a%84%e6%ad%a5%e9%a9%9f-EcErYllOyi\">\u5347\u7d1a\u5167\u6838\u7684\u6b65\u9a5f<\/h2>\n<h3 id=\"%e6%96%b9%e6%b3%95%e4%b8%80%ef%bc%9a%e4%bd%bf%e7%94%a8-elrepo-repository-EcErYllOyi\">\u65b9\u6cd5\u4e00\uff1a\u4f7f\u7528 ELRepo Repository<\/h3>\n<p>ELRepo \u662f\u4e00\u500b\u63d0\u4f9b\u6700\u65b0\u5167\u6838\u7248\u672c\u7684\u7b2c\u4e09\u65b9\u5009\u5eab\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528 ELRepo \u5347\u7d1a\u5167\u6838\u7684\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u5b89\u88dd ELRepo \u5009\u5eab\uff1a<\/li>\n<pre><code>sudo yum install epel-release\nsudo rpm --import https:\/\/www.elrepo.org\/RPM-GPG-KEY-elrepo.org\nsudo yum install https:\/\/www.elrepo.org\/elrepo-release-7.el7.elrepo.noarch.rpm<\/code><\/pre>\n<li>\u5b89\u88dd\u6700\u65b0\u7684\u5167\u6838\u7248\u672c\uff1a<\/li>\n<pre><code>sudo yum --enablerepo=elrepo-kernel install kernel-ml<\/code><\/pre>\n<li>\u78ba\u8a8d\u5b89\u88dd\u7684\u5167\u6838\u7248\u672c\uff1a<\/li>\n<pre><code>rpm -qa | grep kernel<\/code><\/pre>\n<li>\u91cd\u555f\u7cfb\u7d71\u4ee5\u4f7f\u7528\u65b0\u5167\u6838\uff1a<\/li>\n<pre><code>sudo reboot<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3 id=\"%e6%96%b9%e6%b3%95%e4%ba%8c%ef%bc%9a%e4%bd%bf%e7%94%a8-yum-%e5%8d%87%e7%b4%9a%e5%85%a7%e6%a0%b8-EcErYllOyi\">\u65b9\u6cd5\u4e8c\uff1a\u4f7f\u7528 Yum \u5347\u7d1a\u5167\u6838<\/h3>\n<p>\u5982\u679c\u4e0d\u60f3\u4f7f\u7528 ELRepo\uff0c\u9084\u53ef\u4ee5\u901a\u904e Yum \u76f4\u63a5\u5347\u7d1a\u5167\u6838\u3002\u9019\u7a2e\u65b9\u6cd5\u9069\u5408\u65bc\u9700\u8981\u4fdd\u6301\u7cfb\u7d71\u7a69\u5b9a\u6027\u7684\u7528\u6236\uff1a<\/p>\n<ol>\n<li>\u66f4\u65b0 Yum \u5009\u5eab\uff1a<\/li>\n<pre><code>sudo yum update<\/code><\/pre>\n<li>\u5347\u7d1a\u5167\u6838\uff1a<\/li>\n<pre><code>sudo yum upgrade kernel<\/code><\/pre>\n<li>\u91cd\u555f\u7cfb\u7d71\u4ee5\u4f7f\u7528\u65b0\u5167\u6838\uff1a<\/li>\n<pre><code>sudo reboot<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2 id=\"%e6%aa%a2%e6%9f%a5%e6%96%b0%e5%85%a7%e6%a0%b8%e7%89%88%e6%9c%ac-EcErYllOyi\">\u6aa2\u67e5\u65b0\u5167\u6838\u7248\u672c<\/h2>\n<p>\u7cfb\u7d71\u91cd\u555f\u5f8c\uff0c\u53ef\u4ee5\u518d\u6b21\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u7576\u524d\u7684\u5167\u6838\u7248\u672c\uff0c\u4ee5\u78ba\u4fdd\u5347\u7d1a\u6210\u529f\uff1a<\/p>\n<pre><code>uname -r<\/code><\/pre>\n<h2 id=\"%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-EcErYllOyi\">\u6ce8\u610f\u4e8b\u9805<\/h2>\n<ul>\n<li>\u5728\u5347\u7d1a\u5167\u6838\u4e4b\u524d\uff0c\u5efa\u8b70\u5099\u4efd\u91cd\u8981\u6578\u64da\uff0c\u4ee5\u9632\u5347\u7d1a\u904e\u7a0b\u4e2d\u51fa\u73fe\u554f\u984c\u3002<\/li>\n<li>\u5347\u7d1a\u5f8c\uff0c\u67d0\u4e9b\u9a45\u52d5\u7a0b\u5e8f\u6216\u61c9\u7528\u7a0b\u5e8f\u53ef\u80fd\u9700\u8981\u91cd\u65b0\u7de8\u8b6f\u6216\u66f4\u65b0\u3002<\/li>\n<li>\u5982\u679c\u9047\u5230\u554f\u984c\uff0c\u53ef\u4ee5\u901a\u904e GRUB \u83dc\u55ae\u9078\u64c7\u820a\u7248\u672c\u7684\u5167\u6838\u555f\u52d5\u7cfb\u7d71\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-EcErYllOyi\">\u7e3d\u7d50<\/h2>\n<p>\u5347\u7d1a CentOS 7 \u7684\u5167\u6838\u662f\u4e00\u500b\u91cd\u8981\u7684\u7dad\u8b77\u4efb\u52d9\uff0c\u53ef\u4ee5\u63d0\u9ad8\u7cfb\u7d71\u7684\u5b89\u5168\u6027\u548c\u6027\u80fd\u3002\u7121\u8ad6\u662f\u901a\u904e ELRepo \u9084\u662f Yum\uff0c\u5347\u7d1a\u904e\u7a0b\u90fd\u76f8\u5c0d\u7c21\u55ae\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u6027\u548c\u6027\u80fd\u7684\u7528\u6236\uff0c\u5b9a\u671f\u6aa2\u67e5\u548c\u5347\u7d1a\u5167\u6838\u662f\u975e\u5e38\u5fc5\u8981\u7684\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u591a\u6709\u95dc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u7684\u8cc7\u8a0a\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u5982\u4f55\u5728Linux CentOS 7\u4e2d\u5347\u7d1a\u5167\u6838\uff0c\u6b65\u9a5f\u7c21\u55ae\u660e\u77ad\uff0c\u78ba\u4fdd\u7cfb\u7d71\u6027\u80fd\u548c\u5b89\u5168\u6027\u63d0\u5347\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-44410","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/44410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=44410"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/44410\/revisions"}],"predecessor-version":[{"id":44411,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/44410\/revisions\/44411"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=44410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=44410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=44410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}