{"id":1701,"date":"2023-03-25T23:01:17","date_gmt":"2023-03-25T15:01:17","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1701"},"modified":"2023-04-23T21:41:55","modified_gmt":"2023-04-23T13:41:55","slug":"centos-7-upgrade-gcc-and-gpp","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/25\/centos-7-upgrade-gcc-and-gpp\/","title":{"rendered":"CentOS 7 \u5347\u7ea7 gcc \u548c g++"},"content":{"rendered":"<p>\u8d77\u56e0\u662f\u5b89\u88c5 Redis 6 \u9700\u8981\u9ad8\u7248\u672c gcc\uff0c\u4e0d\u8fc7\u5347\u7ea7\u4e00\u4e0b\u603b\u662f\u4e0d\u5dee\u7684\uff0cCentOS 7 \u81ea\u5e26\u7684gcc\u7248\u672c\u662f4.8.5\uff0c\u8fc7\u4e8e\u9648\u65e7\u3002<\/p>\n<ol>\n<li>\n<p><code>gcc -v<\/code>    # \u67e5\u770b\u5f53\u524dgcc\u7248\u672c<\/p>\n<\/li>\n<li>\n<p><code>yum -y install centos-release-scl<\/code>    # \u5b89\u88c5centos-release-scl<\/p>\n<\/li>\n<\/ol>\n<p><!-- more --><\/p>\n<ol start=\"3\">\n<li>\n<p><code>yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils<\/code>    # \u5b89\u88c5gcc\u548cg++<\/p>\n<\/li>\n<li>\n<p><code>scl enable devtoolset-9 bash<\/code>    # \u4f7f\u9ad8\u7248\u672c gcc \u548c g++ 9 \u751f\u6548\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662fscl\u547d\u4ee4\u542f\u7528\u53ea\u662f\u4e34\u65f6\u7684\uff0c\u9000\u51fashell\u6216\u91cd\u65b0\u6253\u5f00\u4e00\u4e2ashell\u5c31\u4f1a\u6062\u590d\u539f\u7cfb\u7edfgcc\u7248\u672c<\/p>\n<\/li>\n<li>\n<p><code>gcc -v<\/code>    # \u67e5\u770b\u66f4\u65b0\u7248\u672c<\/p>\n<\/li>\n<li>\n<p><code>echo &quot;source \/opt\/rh\/devtoolset-9\/enable&quot; &gt;&gt;\/etc\/profile<\/code>    # \u5c06\u66f4\u65b0\u5199\u5165\u7cfb\u7edf\u53d8\u91cf\uff0c\u6c38\u4e45\u751f\u6548<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>SCL(Software Collections)\u53ef\u4ee5\u5728\u540c\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528\u591a\u4e2a\u7248\u672c\u7684\u8f6f\u4ef6\uff0c\u800c\u4e0d\u4f1a\u5f71\u54cd\u6574\u4e2a\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\uff0c\u76f8\u5f53\u4e8e\u4e00\u4e2a\u7248\u672c\u63a7\u5236\u5668<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u8d77\u56e0\u662f\u5b89\u88c5 Redis 6 \u9700\u8981\u9ad8\u7248\u672c gcc\uff0c\u4e0d\u8fc7\u5347\u7ea7\u4e00\u4e0b\u603b\u662f\u4e0d\u5dee\u7684\uff0cCentOS 7 \u81ea\u5e26\u7684gcc\u7248\u672c\u662f4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[425],"class_list":["post-1701","post","type-post","status-publish","format-standard","hentry","category-devops-base","tag-gcc"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1701"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1701\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}