{"id":3640,"date":"2017-01-28T11:04:41","date_gmt":"2017-01-28T02:04:41","guid":{"rendered":"https:\/\/www.pistolfly.com\/weblog\/?p=3640"},"modified":"2018-03-26T17:01:41","modified_gmt":"2018-03-26T08:01:41","slug":"installing-scl-devtoolset-on-centos6","status":"publish","type":"post","link":"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html","title":{"rendered":"Installing scl devtoolset on CentOS6"},"content":{"rendered":"<p>When trying to build nodejs (v6.9.1) on CentOS6, `make` got an error.<br \/>\nIt requires gcc and g++ 4.8 or later, but CentOS6's gcc is 4.4.7.<\/p>\n<p>node-v6.9.1\/BUILDING.md<\/p>\n<blockquote><p>Prerequisites:<\/p>\n<p>* `gcc` and `g++` 4.8 or newer, or<br \/>\n* `clang` and `clang++` 3.4 or newer<br \/>\n* Python 2.6 or 2.7<br \/>\n* GNU Make 3.81 or newer<\/p><\/blockquote>\n<p>So I decided to install gcc and g++ 4.8 or later with scl.<\/p>\n<pre class=\"command-line\">$ sudo yum install centos-release-scl\r\n$ sudo yum install scl-utils\r\n$ sudo yum install devtoolset-4-gcc devtoolset-4-gcc-c++ devtoolset-4-binutils\r\n$ scl enable devtoolset-4 bash\r\n$ gcc --version\r\ngcc (GCC) 5.2.1 20150902 (Red Hat 5.2.1-2)\r\nCopyright (C) 2015 Free Software Foundation, Inc.\r\nThis is free software; see the source for copying conditions.  There is NO\r\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r\n<\/pre>\n<p>There are devtoolset-3 and devtoolset-4. I installed devtoolset-4.<br \/>\nI installed only gcc, g++ and binutils necessary for building nodejs, because it is massive when installing all with devtoolset-4.<\/p>\n<pre class=\"command-line\">$ scl enable &lt; collection1&gt; [&lt; collection1&gt; ...] bash\r\n<\/pre>\n<p>This makes bash start with the environment where the installed collection can be used.<\/p>\n<p>To enable software collections for users after reboot, create under \/etc\/profile.d with the following content.<\/p>\n<pre class=\"command-line\">$ cat \/etc\/profile.d\/enabledevtoolset-4.sh\r\n#!\/bin\/bash\r\nsource scl_source enable devtoolset-4<\/pre>\n<p><a target=\"_blank\" href=\"https:\/\/access.redhat.com\/solutions\/527703\">https:\/\/access.redhat.com\/solutions\/527703<\/a><\/p>\n<h2>Caution<\/h2>\n<p>When devtoolset-4 is enabled, sudo is sometimes broken such as `sudo -i` results in error.<\/p>\n<pre class=\"command-line\">$ sudo -i\r\n[sudo] password for foo:\r\n\/var\/tmp\/sclXXXXXX: line 8: -i: command not found\r\n<\/pre>\n<p><a href=\"https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=1319936\" rel=\"noopener\" target=\"_blank\">https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=1319936<\/a><\/p>\n<p>In such cases, you can use `\/usr\/bin\/sudo` explicitly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When trying to build nodejs (v6.9.1) on CentOS6, `make` got an error. It requires gcc and g++ 4.8 or later, bu &hellip; <a href=\"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Installing scl devtoolset on CentOS6<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"3608","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-3640","post","type-post","status-publish","format-standard","hentry","category-linux","en-US"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Installing scl devtoolset on CentOS6 - Pistolfly<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installing scl devtoolset on CentOS6 - Pistolfly\" \/>\n<meta property=\"og:description\" content=\"When trying to build nodejs (v6.9.1) on CentOS6, `make` got an error. It requires gcc and g++ 4.8 or later, bu &hellip; Continue reading Installing scl devtoolset on CentOS6 &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html\" \/>\n<meta property=\"og:site_name\" content=\"Pistolfly\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-28T02:04:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-26T08:01:41+00:00\" \/>\n<meta name=\"author\" content=\"Pistolfly\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pistolfly\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2017\\\/01\\\/installing-scl-devtoolset-on-centos6.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2017\\\/01\\\/installing-scl-devtoolset-on-centos6.html\"},\"author\":{\"name\":\"Pistolfly\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"headline\":\"Installing scl devtoolset on CentOS6\",\"datePublished\":\"2017-01-28T02:04:41+00:00\",\"dateModified\":\"2018-03-26T08:01:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2017\\\/01\\\/installing-scl-devtoolset-on-centos6.html\"},\"wordCount\":160,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2017\\\/01\\\/installing-scl-devtoolset-on-centos6.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2017\\\/01\\\/installing-scl-devtoolset-on-centos6.html\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2017\\\/01\\\/installing-scl-devtoolset-on-centos6.html\",\"name\":\"Installing scl devtoolset on CentOS6 - Pistolfly\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\"},\"datePublished\":\"2017-01-28T02:04:41+00:00\",\"dateModified\":\"2018-03-26T08:01:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2017\\\/01\\\/installing-scl-devtoolset-on-centos6.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2017\\\/01\\\/installing-scl-devtoolset-on-centos6.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/en\\\/2017\\\/01\\\/installing-scl-devtoolset-on-centos6.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installing scl devtoolset on CentOS6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/\",\"name\":\"Pistolfly\",\"description\":\"Developer Blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\",\"name\":\"Pistolfly\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"caption\":\"Pistolfly\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\"},\"description\":\"Software Engineer in Tokyo, Japan\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/author\\\/pistolfly\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Installing scl devtoolset on CentOS6 - Pistolfly","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html","og_locale":"en_US","og_type":"article","og_title":"Installing scl devtoolset on CentOS6 - Pistolfly","og_description":"When trying to build nodejs (v6.9.1) on CentOS6, `make` got an error. It requires gcc and g++ 4.8 or later, bu &hellip; Continue reading Installing scl devtoolset on CentOS6 &rarr;","og_url":"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html","og_site_name":"Pistolfly","article_published_time":"2017-01-28T02:04:41+00:00","article_modified_time":"2018-03-26T08:01:41+00:00","author":"Pistolfly","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Pistolfly","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html#article","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html"},"author":{"name":"Pistolfly","@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"headline":"Installing scl devtoolset on CentOS6","datePublished":"2017-01-28T02:04:41+00:00","dateModified":"2018-03-26T08:01:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html"},"wordCount":160,"commentCount":0,"publisher":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"articleSection":["Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html","url":"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html","name":"Installing scl devtoolset on CentOS6 - Pistolfly","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#website"},"datePublished":"2017-01-28T02:04:41+00:00","dateModified":"2018-03-26T08:01:41+00:00","breadcrumb":{"@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pistolfly.com\/weblog\/en\/2017\/01\/installing-scl-devtoolset-on-centos6.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/www.pistolfly.com\/weblog"},{"@type":"ListItem","position":2,"name":"Installing scl devtoolset on CentOS6"}]},{"@type":"WebSite","@id":"https:\/\/www.pistolfly.com\/weblog\/#website","url":"https:\/\/www.pistolfly.com\/weblog\/","name":"Pistolfly","description":"Developer Blog","publisher":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pistolfly.com\/weblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab","name":"Pistolfly","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","caption":"Pistolfly"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g"},"description":"Software Engineer in Tokyo, Japan","url":"https:\/\/www.pistolfly.com\/weblog\/author\/pistolfly"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paorzz-WI","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/3640","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/comments?post=3640"}],"version-history":[{"count":11,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/3640\/revisions"}],"predecessor-version":[{"id":4322,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/3640\/revisions\/4322"}],"wp:attachment":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/media?parent=3640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/categories?post=3640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/tags?post=3640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}