{"id":1664,"date":"2021-12-16T13:58:44","date_gmt":"2021-12-16T10:58:44","guid":{"rendered":"https:\/\/files2.tojikon.net\/files-cloud\/2021\/03\/22\/how-to-install-gcc-on-ubuntu\/https:\/\/files2.tojikon.net\/files-cloud\/2021\/03\/22\/how-to-install-gcc-on-ubuntu\/"},"modified":"2021-12-16T13:58:44","modified_gmt":"2021-12-16T10:58:44","slug":"how-to-install-gcc-on-ubuntu","status":"publish","type":"post","link":"https:\/\/tojikon.net\/en\/1664-how-to-install-gcc-on-ubuntu\/","title":{"rendered":"How to install GCC on Ubuntu"},"content":{"rendered":"<section id=\"related_posts\">\n<div class=\"block-head\">\n<h3>Related Articles<\/h3>\n<\/div>\n<\/section>\n<p>Need to install GCC on your Ubuntu system but can\u2019t figure out how to set it up? If so, this guide is for you! Follow along below as we show you how to install GCC on Ubuntu!<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-397918 size-full\" src=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu.png\" alt=\" install GCC on Ubuntu\" width=\"1200\" height=\"573\" srcset=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu.png 1200w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-3.png 300w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-5.png 1024w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-6.png 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\"\/><\/p>\n<h2>Install GCC on Ubuntu \u2013 Terminal<\/h2>\n<p>The GCC (GNU Compiler Collection) is installable on Ubuntu through the command-line terminal. To install it, you will need to download and set up the \u201cbuild-essential\u201d package on Ubuntu. To start the installation process, open up a terminal window.\u00a0<\/p>\n<p>To open up a terminal window on the desktop, press <strong>Ctrl + Alt + T\u00a0<\/strong>on the keyboard. Or, open up the app menu and search for \u201cTerminal\u201d to open it up.\u00a0<\/p>\n<p>Once the terminal window is open, make use of the\u00a0<strong>apt install\u00a0<\/strong>command below and use it to install the \u201cbuild-essential\u201d package on Ubuntu.\u00a0<\/p>\n<pre>\nsudo apt install build-essential\n<\/pre>\n<p>After entering the command above, Ubuntu will ask you for your password. Your password is requested due to the <strong>sudo\u00a0<\/strong>command. This command allows users to execute a single command as root. To continue, enter your user password.<\/p>\n<p>Note: while entering your password with\u00a0<strong>sudo<\/strong>, you will not see any password feedback. If this bothers you, please follow along with our guide on how to turn on password feedback.<\/p>\n<p>When you\u2019ve entered your password, the terminal prompt will collect all dependencies related to the \u201cbuild-essential\u201d package. From there, Ubuntu will ask you if you want to install the package. Press the\u00a0<strong>Y<\/strong> key\u00a0to continue.<\/p>\n<p>Once the\u00a0<strong>Y\u00a0<\/strong>key is pressed, Ubuntu will start installing GCC on your computer. This process shouldn\u2019t take long at all. When the process is complete, you can view the GCC manual with the\u00a0<strong>man gcc\u00a0<\/strong>command.<\/p>\n<h3>Installing multiple versions of GCC \u2013 Terminal<\/h3>\n<p>While installing the \u201cbuild-essential\u201d package on Ubuntu is good enough for most Ubuntu users, as it is GCC 10, it\u2019s not the only version of GCC you can install. If you\u2019d like to install multiple versions of GCC on Ubuntu, you can. Here\u2019s how.<\/p>\n<p>First, open up a terminal window on the Ubuntu desktop. Once it is open, use the\u00a0<strong>apt search\u00a0<\/strong>command to search the available\u00a0<strong>GCC\u00a0<\/strong>packages in the Ubuntu software repositories.<\/p>\n<pre>\napt search gcc\n<\/pre>\n<p>Look through the prompt and find the version of GCC you\u2019d like to install on Ubuntu. As of now, it is possible to install GCC 7, GCC 8, 9, and 10 (which is installed via the \u201cbuild-essential\u201d package).<\/p>\n<p>Note: can\u2019t find the GCC version you want through the\u00a0<strong>apt search\u00a0<\/strong>results?\u00a0<\/p>\n<p>Once you\u2019ve located the version of GCC you\u2019d like to install on your Ubuntu PC, install it using the\u00a0<strong>apt install\u00a0<\/strong>commands below. GCC packages are gcc-7, gcc-8, gcc-9, and gcc-10.<\/p>\n<p>To install GCC version 7 on Ubuntu, install both the gcc-7 and g++-7 packages.\u00a0<\/p>\n<pre>\nsudo apt install gcc-7 g++-7\n<\/pre>\n<p>To install the GCC version 8 on Ubuntu, install both the gcc-8 and g++-8 packages.<\/p>\n<pre>\nsudo apt install gcc-8 g++-8\n<\/pre>\n<p>Need to get GCC version 9 on your computer? Install the gcc-9 and g++-9 packages.<\/p>\n<pre>\nsudo apt install gcc-9 g++-9\n<\/pre>\n<p>While it\u2019s highly recommended you install the \u201cbuild-essential\u201d package to get GCC 10 working on Ubuntu, that\u2019s not the only way to install it on your computer. You can also install GCC 10 by installing the gcc-10 and g++-10 packages.<\/p>\n<pre>\nsudo apt install gcc-10 g++-10 <\/pre>\n<h2>Install GCC on Ubuntu \u2013 Synaptic Package Manager<\/h2>\n<p>If you need to get GCC working on Ubuntu but don\u2019t want to use the terminal, you can do it with the Synaptic Package Manager. To start, ensure you have Synaptic installed. To install Synaptic, open up the Ubuntu Software app, search for \u201cSynaptic,\u201d and install it.<\/p>\n<p>Once the Synaptic Package Manager is installed, open it by searching for it in the app menu. Then, locate the search button in the top-right corner of the screen. After selecting the Synaptic search button, type out \u201cbuild-essential\u201d and press the <strong>Enter\u00a0<\/strong>key to view the search results.\u00a0<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-397918 size-full\" src=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu.png\" alt=\"\" width=\"1200\" height=\"573\" srcset=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu.png 1200w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-3.png 300w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-5.png 1024w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-6.png 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\"\/><\/p>\n<p>Look through the search results in Synaptic for \u201cbuild-essential.\u201d When you\u2019ve found it, right-click on it with the mouse and select the \u201cMark for installation\u201d button to mark the \u201cbuild-essential\u201d package for installation in Synaptic.<\/p>\n<p>Find the \u201cApply\u201d button in Synaptic, and click on it to start the installation of GCC on Ubuntu.<\/p>\n<h3>Installing multiple versions of GCC \u2013 Synaptic Package Manager<\/h3>\n<p>Need to install a different GCC version to Ubuntu rather than the one provided with the \u201cbuild-essential\u201d package? Do the following. First, open up Synaptic Package Manager.<\/p>\n<p>Once Synaptic is open, find the search button, and click on it with the mouse. Then, choose one of the packages listed below and type them into the search box.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-397919 size-full\" src=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-1.png\" alt=\"\" width=\"1200\" height=\"543\" srcset=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-1.png 1200w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-8.png 300w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-10.png 1024w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-12.png 768w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-install-gcc-on-ubuntu-14.png 1040w\" sizes=\"(max-width: 1200px) 100vw, 1200px\"\/><\/p>\n<ul>\n<li>GCC 7: gcc-7, g++-7<\/li>\n<li>GCC 8: gcc-8, g++-8<\/li>\n<li>GCC 9: gcc-9, g++-9<\/li>\n<li>GCC 10: gcc-10, g++-10<\/li>\n<\/ul>\n<p>Right-click on the GCC package(s) you\u2019ve searched for in Synaptic, and select the \u201cApply\u201d button to install it. Repeat this process to install as many versions of GCC to Ubuntu as desired.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Related Articles Need to install GCC on your Ubuntu system but can\u2019t figure out how to set it up? If so, this guide is for you! Follow along below as we show you how to install GCC on Ubuntu! Install GCC on Ubuntu \u2013 Terminal The GCC (GNU Compiler Collection) is installable on Ubuntu through &hellip;<\/p>\n","protected":false},"author":1,"featured_media":1665,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21],"tags":[33],"_links":{"self":[{"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/posts\/1664"}],"collection":[{"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/comments?post=1664"}],"version-history":[{"count":0,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/posts\/1664\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/media\/1665"}],"wp:attachment":[{"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/media?parent=1664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/categories?post=1664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/tags?post=1664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}