{"id":1000,"date":"2019-11-30T13:58:27","date_gmt":"2019-11-30T19:58:27","guid":{"rendered":"https:\/\/linuxhostsupport.com\/blog\/?p=1000"},"modified":"2019-11-30T13:58:27","modified_gmt":"2019-11-30T19:58:27","slug":"how-to-install-gcc-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/","title":{"rendered":"How to Install GCC on Ubuntu 18.04"},"content":{"rendered":"<div id=\"linux-1181194915\" class=\"linux-before-1st-paragraph linux-entity-placement\" style=\"margin-top: 15px;margin-bottom: 15px;\"><a href=\"https:\/\/www.rosehosting.com\/managed-vps-hosting\/?mtm_campaign=blogs&#038;mtm_source=lhs&#038;mtm_medium=blog&#038;mtm_content=managed-vps&#038;mtm_cid=1339&#038;mtm_placement=inline\" aria-label=\"Untitled\"><img src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322.jpg\" alt=\"\"  srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322.jpg 728w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322-300x37.jpg 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" width=\"728\" height=\"90\"  style=\"display: inline-block;\" \/><\/a><\/div><p>In this article, we will show you how to install GCC on an\u00a0Ubuntu 18.04 server.<\/p>\n<p><img decoding=\"async\" class=\"alignright size-full wp-image-1008\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/setting-up-gcc-compiler-for-ubuntu18.04-server.jpg\" alt=\"\" width=\"140\" height=\"79\" \/>If we use the apt command to install GCC from a repository, we will have the default GCC version (GCC 7.4). However, if you want the latest version of GCC, you will need to install it from source. Version 8 of GCChas complete C++11, C++14 support, partial C++17 support, and experimental C++2a support. With GCC 8, C11 and C++14 support are enabled by default, and there is no need to add -std=c11 or -std=c++14. Let&#8217;s get started.<\/p>\n<p><!--more--><\/p>\n<h2>Step 1. Update the Server<\/h2>\n<p>Like always, we need to make sure that we have an up-to-date system. This ensures compatibility between packages:<\/p>\n<pre>sudo apt update &amp;&amp; sudo apt upgrade<\/pre>\n<h2>Step 2. Install GCC<\/h2>\n<h3>Method 1: Install GCC from Source<\/h3>\n<p>Before we start with the installation, it is highly recommended to start a screen session. This will ensure that all actions that we perform will persist on the server even if our connection times out.<\/p>\n<p>Run the following command:<\/p>\n<pre>screen -U -S gcc<\/pre>\n<p>Now, we will install the default GCC toolchain with this command:<\/p>\n<pre>sudo apt install build-essential<\/pre>\n<p>Next, from the official documentation for GCC 8 at <code>https:\/\/gcc.gnu.org\/mirrors.html<\/code> we will download the prerequisites and the source code.<\/p>\n<pre>cd ~\r\nwget https:\/\/ftpmirror.gnu.org\/gcc\/gcc-8.2.0\/gcc-8.2.0.tar.gz\r\ntar xf gcc-8.2.0.tar.gz\r\ncd gcc-8.2.0\r\ncontrib\/download_prerequisites<\/pre>\n<p>In this step, we will configure the construction parameters. The best way to keep the system clean is to use <code>\/usr\/local\/gcc-8.2<\/code> for the installation directory and add the suffix -8.2 to the GCC compilers. We do not want to mess the system\u2019s default GCC because other packages may depend on the default version. Of course, if you&#8217;re installing a version newer than 8.2, you can rename the folders to the correct version number.<\/p>\n<pre>cd ~\r\nmkdir build &amp;&amp; cd build\r\n..\/gcc-8.2.0\/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=\/usr\/local\/gcc-8.2 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-8.2<\/pre>\n<p>Again, rename the version number if necessary. The above command runs a script that prepares the program to compile the source code specifically for your server.<\/p>\n<p>We are ready to build GCC. At this point, it is very important to know that the build may take a long time. To speed up the process we can use as twice the number of our computer cores. In our example, we will use 8 parallel jobs to build GCC:<\/p>\n<pre>make -j 8<\/pre>\n<p>Build phase depends on the speed of your server. This may take from a few minutes to a few hours to complete the build, depending on your server&#8217;s hardware capabilities.<\/p>\n<p>Once the build is finished, we can continue to actually installing GCC with the following command:<\/p>\n<pre>sudo make install<\/pre>\n<p>With adding the following lines at the end of the .bashrc file, we will permanently add the compilers to the system&#8217;s path.<\/p>\n<pre>nano \/root\/.bashrc<\/pre>\n<p>Add this to the end of that file:<\/p>\n<pre>export export PATH=\/usr\/local\/gcc-8.2\/bin:$PATH\r\nexport LD_LIBRARY_PATH=\/usr\/local\/gcc-8.2\/lib64:$LD_LIBRARY_PATH<\/pre>\n<p>With this command, we will reload .bashrc without restarting the machine:<\/p>\n<pre>. .bashrc<\/pre>\n<h3>Method 2: Install GCC from Repository<\/h3>\n<p>As we mentioned at the beginning of this tutorial, we can easily install GCC compiler on Ubuntu 18.04 by typing the following command:<\/p>\n<pre>sudo apt install gcc gcc-8 g++-8<\/pre>\n<p>However, there is another way to install GCC through the build-essential package. This package will also install additional libraries as well as g++ compiler.<\/p>\n<pre>sudo apt install build-essential<\/pre>\n<h2>Step 3. Verify GCC Installation<\/h2>\n<p>We can check if GCC is properly installed with the command below:<\/p>\n<pre>sudo whereis gcc make<\/pre>\n<p>Output:<\/p>\n<pre>gcc: \/usr\/bin\/gcc \/usr\/lib\/gcc \/usr\/share\/man\/man1\/gcc.1.gz\r\nmake: \/usr\/bin\/make \/usr\/share\/man\/man1\/make.1.gz \/usr\/share\/man\/man1\/make.1posix.gz<\/pre>\n<p>Alternatively, we can run<\/p>\n<pre>sudo gcc-8 --version<\/pre>\n<p>Output:<\/p>\n<pre>gcc-8 (Ubuntu 8.2.0-1ubuntu2~18.04) 8.2.0\r\nCopyright (C) 2018 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.<\/pre>\n<p>To get the version of make, you can use these commands:<\/p>\n<pre>make -v<\/pre>\n<p>or<\/p>\n<pre>make --version<\/pre>\n<p>and we will have an output similar to this:<\/p>\n<pre>GNU Make 4.1\r\nBuilt for x86_64-pc-linux-gnu\r\nCopyright (C) 1988-2014 Free Software Foundation, Inc.\r\nLicense GPLv3+: GNU GPL version 3 or later &lt;http:\/\/gnu.org\/licenses\/gpl.html&gt;\r\nThis is free software: you are free to change and redistribute it.\r\nThere is NO WARRANTY, to the extent permitted by law.<\/pre>\n<h2>Step 4. Installation of dev Man Pages<\/h2>\n<p>If we want to install the dev man pages just we need to execute the command:<\/p>\n<pre>sudo apt-get install manpages-dev man-db manpages-posix-dev<\/pre>\n<p>If we want to view the library cells, we can run:<\/p>\n<pre>man 3 scanf<\/pre>\n<p>Output:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1002\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/man3scanf.jpg\" alt=\"\" width=\"641\" height=\"382\" srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/man3scanf.jpg 641w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/man3scanf-300x179.jpg 300w\" sizes=\"(max-width: 641px) 100vw, 641px\" \/><\/p>\n<pre>man 2 execve<\/pre>\n<p>Output:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1003\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/man2execve.jpg\" alt=\"\" width=\"640\" height=\"383\" srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/man2execve.jpg 640w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/man2execve-300x180.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<pre>man 2 fork<\/pre>\n<p>Output:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1004\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/man2fork.jpg\" alt=\"\" width=\"639\" height=\"383\" srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/man2fork.jpg 639w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/man2fork-300x180.jpg 300w\" sizes=\"(max-width: 639px) 100vw, 639px\" \/><\/p>\n<p>After we finished and confirmed that we have installed the compilers and all the main components, it&#8217;s time to test the GNU GCC compiler.<\/p>\n<h2>Step 5. Test GCC compilers<\/h2>\n<p>In order to test our compilers, we will run a few very simple C++ programs.<\/p>\n<p>Open your favorite editor (in our example we are using nano as editor)<\/p>\n<pre>nano hello_world.cpp<\/pre>\n<p>and enter the code inside.<\/p>\n<pre>\/\/ Simple C++ \"Hello World\" program\r\n\r\n\/\/ Header file for input output functions\r\n#include\r\n\r\nusing namespace std;\r\n\r\n\/\/ main function -\r\n\/\/ where the execution of program begins\r\n\r\nint main()\r\n{\r\n\/\/ prints hello world\r\ncout&lt;&lt;\"Hello World ! \\n\";\r\n\r\nreturn 0;\r\n}<\/pre>\n<p>After we save our project, we can compile it with the following command:<\/p>\n<pre>g++ hello_world.cpp -o hello<\/pre>\n<p>When the compiling process is done, there should be a file called hello in the current directory. We can check this if we list the files and directories with this command:<\/p>\n<pre>ls -lah<\/pre>\n<p>Now we can test our project with:<\/p>\n<pre>.\/hello<\/pre>\n<p>By executing the hello command we will receive the following output:<\/p>\n<pre>Hello world !<\/pre>\n<p>In the following example, we can test the generalized lambda capture, also known as init capture that was introduced in the C++ 14 standard.<\/p>\n<pre>nano test.cpp<\/pre>\n<pre>\/\/ C++14 standard could use \"auto\" for the type of a parameter\r\n#include\r\n\r\nint main() {\r\nstd::cout &lt;&lt; [](auto a, auto b) { return a + b; } (4, 3) &lt;&lt; std::endl;\r\nstd::cout &lt;&lt; [](auto a, auto b) { return a + b; } (4.23, 6.25) &lt;&lt; std::endl;\r\nreturn 0;\r\n}<\/pre>\n<p>Paste the code inside the test.cpp and save it. Now we can compile our code with the command:<\/p>\n<pre>g++-8 -Wall -pedantic test.cpp -o test<\/pre>\n<p>When the compiling process is complete, we can execute:<\/p>\n<pre>.\/test<\/pre>\n<p>And we will receive the following output:<\/p>\n<pre>7\r\n10.48<\/pre>\n<p>And that&#8217;s it. In this article we managed to install the GCC compiler from source and repository, we also verified the installation of GCC. We installed the dev man pages, and at the end, we tested the GCC compilers with two very simple examples.<\/p>\n<hr \/>\n<p><img decoding=\"async\" class=\"alignleft size-full wp-image-1009\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/fully-managed-support-for-gcc-setup-configuration-install-on-ubuntu-vps.jpg\" alt=\"\" width=\"140\" height=\"79\" \/>Of course, you don\u2019t have to install GCC on Ubuntu 18.04 if you use one of our <a href=\"http:\/\/linuxhostsupport.com\/monthly-server-management.html\">Managed VPS Support<\/a>\u00a0services, in which case you can simply ask our expert Linux admins to install GCC on your Ubuntu 18.04 server for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n<p><strong>PS<\/strong>. If you liked this post on\u00a0<strong>how to install GCC on Ubuntu 18.04<\/strong>, or if you found it helpful, please share it with your friends on the social networks using the share shortcuts, or simply leave a reply below. Thanks.<\/p><div id=\"linux-3154704372\" class=\"linux-after-8th-paragraph linux-entity-placement\" style=\"margin-top: 15px;margin-bottom: 15px;\"><a href=\"https:\/\/www.rosehosting.com\/managed-vps-hosting\/?mtm_campaign=blogs&#038;mtm_source=lhs&#038;mtm_medium=blog&#038;mtm_content=managed-vps&#038;mtm_cid=1340&#038;mtm_placement=inline\" aria-label=\"Untitled\"><img src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622.jpg\" alt=\"\"  srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622.jpg 728w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622-300x37.jpg 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" width=\"728\" height=\"90\"  style=\"display: inline-block;\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will show you how to install GCC on an\u00a0Ubuntu 18.04 server. If we use the apt command to install GCC from a repository, we will have the default GCC version (GCC 7.4). However, if you want the latest version of GCC, you will need to install it from source. Version 8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1007,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1000","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-miscellaneous"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install GCC on Ubuntu 18.04 | LinuxHostSupport<\/title>\n<meta name=\"description\" content=\"In this article, we will show you how to install GCC on an\u00a0Ubuntu 18.04 server. If we use the apt command to install GCC from a repository, we will have\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install GCC on Ubuntu 18.04 | LinuxHostSupport\" \/>\n<meta property=\"og:description\" content=\"In this article, we will show you how to install GCC on an\u00a0Ubuntu 18.04 server. If we use the apt command to install GCC from a repository, we will have\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxHostSupport\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/linuxhostsupport\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-30T19:58:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/how-to-install-gcc-on-ubuntu18.04.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"410\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@lnxhostsupport\" \/>\n<meta name=\"twitter:site\" content=\"@lnxhostsupport\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb\"},\"headline\":\"How to Install GCC on Ubuntu 18.04\",\"datePublished\":\"2019-11-30T19:58:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/\"},\"wordCount\":883,\"commentCount\":1,\"image\":{\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/how-to-install-gcc-on-ubuntu18.04.jpg\",\"articleSection\":[\"Miscellaneous\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/\",\"url\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/\",\"name\":\"How to Install GCC on Ubuntu 18.04 | LinuxHostSupport\",\"isPartOf\":{\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/how-to-install-gcc-on-ubuntu18.04.jpg\",\"datePublished\":\"2019-11-30T19:58:27+00:00\",\"author\":{\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb\"},\"description\":\"In this article, we will show you how to install GCC on an\u00a0Ubuntu 18.04 server. If we use the apt command to install GCC from a repository, we will have\",\"breadcrumb\":{\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#primaryimage\",\"url\":\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/how-to-install-gcc-on-ubuntu18.04.jpg\",\"contentUrl\":\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/how-to-install-gcc-on-ubuntu18.04.jpg\",\"width\":750,\"height\":410},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/linuxhostsupport.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install GCC on Ubuntu 18.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/#website\",\"url\":\"https:\/\/linuxhostsupport.com\/blog\/\",\"name\":\"LinuxHostSupport\",\"description\":\"Linux Tutorials and Guides\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/linuxhostsupport.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/linuxhostsupport.com\/blog\/author\/r0s3admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install GCC on Ubuntu 18.04 | LinuxHostSupport","description":"In this article, we will show you how to install GCC on an\u00a0Ubuntu 18.04 server. If we use the apt command to install GCC from a repository, we will have","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:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install GCC on Ubuntu 18.04 | LinuxHostSupport","og_description":"In this article, we will show you how to install GCC on an\u00a0Ubuntu 18.04 server. If we use the apt command to install GCC from a repository, we will have","og_url":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/","og_site_name":"LinuxHostSupport","article_publisher":"https:\/\/www.facebook.com\/linuxhostsupport","article_published_time":"2019-11-30T19:58:27+00:00","og_image":[{"width":750,"height":410,"url":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/how-to-install-gcc-on-ubuntu18.04.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@lnxhostsupport","twitter_site":"@lnxhostsupport","twitter_misc":{"Written by":"admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#article","isPartOf":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/"},"author":{"name":"admin","@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb"},"headline":"How to Install GCC on Ubuntu 18.04","datePublished":"2019-11-30T19:58:27+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/"},"wordCount":883,"commentCount":1,"image":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/how-to-install-gcc-on-ubuntu18.04.jpg","articleSection":["Miscellaneous"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/","url":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/","name":"How to Install GCC on Ubuntu 18.04 | LinuxHostSupport","isPartOf":{"@id":"https:\/\/linuxhostsupport.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#primaryimage"},"image":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/how-to-install-gcc-on-ubuntu18.04.jpg","datePublished":"2019-11-30T19:58:27+00:00","author":{"@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb"},"description":"In this article, we will show you how to install GCC on an\u00a0Ubuntu 18.04 server. If we use the apt command to install GCC from a repository, we will have","breadcrumb":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#primaryimage","url":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/how-to-install-gcc-on-ubuntu18.04.jpg","contentUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2019\/11\/how-to-install-gcc-on-ubuntu18.04.jpg","width":750,"height":410},{"@type":"BreadcrumbList","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-gcc-on-ubuntu-18-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxhostsupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install GCC on Ubuntu 18.04"}]},{"@type":"WebSite","@id":"https:\/\/linuxhostsupport.com\/blog\/#website","url":"https:\/\/linuxhostsupport.com\/blog\/","name":"LinuxHostSupport","description":"Linux Tutorials and Guides","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxhostsupport.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/linuxhostsupport.com\/blog\/author\/r0s3admin\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/1000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/comments?post=1000"}],"version-history":[{"count":5,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/1000\/revisions"}],"predecessor-version":[{"id":1011,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/1000\/revisions\/1011"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/media\/1007"}],"wp:attachment":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/media?parent=1000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/categories?post=1000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/tags?post=1000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}