{"id":392,"date":"2020-12-21T07:34:14","date_gmt":"2020-12-21T07:34:14","guid":{"rendered":"https:\/\/www.shanawanka.com\/?p=392"},"modified":"2021-01-09T12:55:31","modified_gmt":"2021-01-09T12:55:31","slug":"how-to-install-gcc-compiler-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.shanawanka.com\/it\/how-to-install-gcc-compiler-on-ubuntu\/","title":{"rendered":"How to Install GCC Compiler on Ubuntu"},"content":{"rendered":"<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Te able to add new repositories and install packages on your Ubuntu system, you must be logged in as root or&nbsp;user with Sudo privileges.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installing-gcc-on-ubuntu\">Installing GCC on Ubuntu<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The default Ubuntu repositories contain a meta-package named&nbsp;<code>build-essential<\/code>&nbsp;that contains the GCC compiler and a lot of libraries and other utilities required for compiling software.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" title=\"YouTube video player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/WTtHCFg3XJs?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=it-IT&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Perform the steps below to install the GCC Compiler in any version of Ubuntu:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Start by updating the packages list:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code><em>$ sudo apt update<\/em><\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Install the&nbsp;<code>build-essential<\/code>&nbsp;package by typing:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt install build-essential<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The command installs a bunch of new packages including&nbsp;<code>gcc<\/code>,&nbsp;<code>g++<\/code>&nbsp;and&nbsp;<code>make<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may also want to install the manual pages about using GNU\/Linux for development:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt-get install manpages-dev<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>To validate that the GCC compiler is successfully installed, use the&nbsp;<code>gcc --version<\/code>&nbsp;a command which prints the GCC version:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>This 2 commands are same:\n$ gcc --version \n$ gcc -v<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it. GCC is now installed on your system, and you can start using it.<\/p>","protected":false},"excerpt":{"rendered":"<p>Prerequisites Te able to add new repositories and install packages on your Ubuntu system, you must be logged in as root or&nbsp;user with Sudo privileges. Installing GCC on Ubuntu The default Ubuntu repositories contain a meta-package named&nbsp;build-essential&nbsp;that contains the GCC compiler and a lot of libraries and other utilities required for compiling software. Perform the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[62],"tags":[69,76,67,70],"class_list":["post-392","post","type-post","status-publish","format-standard","hentry","category-os-linux","tag-linux","tag-shanawanka","tag-ubuntu","tag-windows"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.shanawanka.com\/it\/wp-json\/wp\/v2\/posts\/392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shanawanka.com\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shanawanka.com\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shanawanka.com\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shanawanka.com\/it\/wp-json\/wp\/v2\/comments?post=392"}],"version-history":[{"count":14,"href":"https:\/\/www.shanawanka.com\/it\/wp-json\/wp\/v2\/posts\/392\/revisions"}],"predecessor-version":[{"id":534,"href":"https:\/\/www.shanawanka.com\/it\/wp-json\/wp\/v2\/posts\/392\/revisions\/534"}],"wp:attachment":[{"href":"https:\/\/www.shanawanka.com\/it\/wp-json\/wp\/v2\/media?parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shanawanka.com\/it\/wp-json\/wp\/v2\/categories?post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shanawanka.com\/it\/wp-json\/wp\/v2\/tags?post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}