{"id":491,"date":"2020-05-17T02:33:47","date_gmt":"2020-05-17T02:33:47","guid":{"rendered":"http:\/\/achrafothman.net\/site\/?p=491"},"modified":"2020-05-17T04:04:10","modified_gmt":"2020-05-17T04:04:10","slug":"how-to-downgrade-gcc-and-g-in-ubuntu","status":"publish","type":"post","link":"https:\/\/achrafothman.net\/site\/how-to-downgrade-gcc-and-g-in-ubuntu\/","title":{"rendered":"How to downgrade GCC and G++ in Ubuntu?"},"content":{"rendered":"\n<p>Downgrading GCC and G++ compilers in Ubuntu is mandatory to build some packages (like IRSTLM, Giza++, Moses, etc.). In this tutorial, I will present an easy way to install gcc-4.4, gcc-4.6, gcc-4.9, g++-4.4, g++-4.6, and, g++-4.9.<\/p>\n\n\n\n<p>First of all, you need to update the sources repository using a text editor like vi as follow:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    vi \/etc\/apt\/sources.list<\/pre>\n\n\n\n<p>At the end of the file, just append the following lines:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    #gcc-4.9 g++-4.9 g++-4.9-multilib\n    deb http:\/\/dk.archive.ubuntu.com\/ubuntu xenial main\n    deb http:\/\/dk.archive.ubuntu.com\/ubuntu xenial universe\n\n    #gcc-4.4 g++-4.4 g++-4.4-multilib\n    deb http:\/\/dk.archive.ubuntu.com\/ubuntu\/ trusty main universe\n    deb http:\/\/dk.archive.ubuntu.com\/ubuntu\/ trusty-updates main universe\n\n    #gcc-4.6 g++-4.6 g++-4.6-multilib\n    deb http:\/\/dk.archive.ubuntu.com\/ubuntu\/ precise main universe\n    deb http:\/\/dk.archive.ubuntu.com\/ubuntu\/ precise-updates main universe<\/pre>\n\n\n\n<p>To save just type escape, and then enter wq! to quit vi with saving mode.<\/p>\n\n\n\n<p>To update the repository, just run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    sudo apt-get update<\/pre>\n\n\n\n<p>Now, to install gcc-4.4, gcc-4.6, gcc-4.9, g++-4.4, g++-4.6, and, g++-4.9, just run the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    sudo apt-get install gcc-4.9 g++-4.9 g++-4.9-multilib\n    sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib\n    sudo apt-get install gcc-4.6 g++-4.6 g++-4.6-multilib<\/pre>\n\n\n\n<p>At this stage, you completed the setup of different versions of gcc and g++ in your OS. To select a default gcc and g++ compiler, we need to configure the alternative options of compilers through the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    sudo update-alternatives --install \/usr\/bin\/gcc gcc \/usr\/bin\/gcc-4.4 50\n    sudo update-alternatives --install \/usr\/bin\/g++ g++ \/usr\/bin\/g++-4.4 50\n    sudo update-alternatives --install \/usr\/bin\/gcc gcc \/usr\/bin\/gcc-4.6 50\n    sudo update-alternatives --install \/usr\/bin\/g++ g++ \/usr\/bin\/g++-4.6 50\n    sudo update-alternatives --install \/usr\/bin\/gcc gcc \/usr\/bin\/gcc-4.9 50\n    sudo update-alternatives --install \/usr\/bin\/g++ g++ \/usr\/bin\/g++-4.9 50\n    sudo update-alternatives --install \/usr\/bin\/gcc gcc \/usr\/bin\/gcc-9 50\n    sudo update-alternatives --install \/usr\/bin\/g++ g++ \/usr\/bin\/g++-9 50<\/pre>\n\n\n\n<p>To change the default gcc version, just run the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    sudo update-alternatives --config gcc<\/pre>\n\n\n\n<p>and select through the keypad (1, 2, 3, 4, etc.) the version of gcc and same for g++ as follow:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    sudo update-alternatives --config g++<\/pre>\n\n\n\n<p>  I hope that you enjoyed this tutorial. <\/p>\n\n\n\n<p>Don&#8217;t forget to visit my channel on <a href=\"https:\/\/www.youtube.com\/channel\/UCqXbfAw1pIq0e3Damnf7-dA\" target=\"_blank\" aria-label=\"YouTube  (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"aioseop-link\">YouTube <\/a>for more tutorials.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Downgrading GCC and G++ compilers in Ubuntu is mandatory to build some packages (like IRSTLM, Giza++, Moses, etc.). In this tutorial, I will present an easy way to install gcc-4.4, gcc-4.6, gcc-4.9, g++-4.4, g++-4.6, and, g++-4.9. First of all, you need to update the sources repository using a text editor like vi as follow: vi<\/p>\n","protected":false},"author":1,"featured_media":496,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":""},"categories":[4],"tags":[113,109,110,107,108,115,112,114,111,88,89],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?fit=905%2C501&ssl=1","uagb_featured_image_src":{"full":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?fit=905%2C501&ssl=1",905,501,false],"thumbnail":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=150%2C150&ssl=1",150,150,true],"medium":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?fit=300%2C166&ssl=1",300,166,true],"medium_large":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?fit=768%2C425&ssl=1",768,425,true],"large":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?fit=770%2C426&ssl=1",770,426,true],"1536x1536":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?fit=905%2C501&ssl=1",905,501,true],"2048x2048":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?fit=905%2C501&ssl=1",905,501,true],"post-thumbnail":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=270%2C180&ssl=1",270,180,true],"contentberg-main":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=770%2C501&ssl=1",770,501,true],"contentberg-main-full":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=905%2C501&ssl=1",905,501,true],"contentberg-slider-stylish":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=900%2C501&ssl=1",900,501,true],"contentberg-slider-carousel":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=370%2C370&ssl=1",370,370,true],"contentberg-slider-grid-b":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=554%2C466&ssl=1",554,466,true],"contentberg-slider-grid-b-sm":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=306%2C466&ssl=1",306,466,true],"contentberg-slider-bold-sm":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=150%2C150&ssl=1",150,150,true],"contentberg-grid":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=370%2C245&ssl=1",370,245,true],"contentberg-list":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=260%2C200&ssl=1",260,200,true],"contentberg-list-b":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=370%2C305&ssl=1",370,305,true],"contentberg-thumb":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=87%2C67&ssl=1",87,67,true],"contentberg-thumb-alt":["https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/gcc-logo.jpg?resize=150%2C150&ssl=1",150,150,true]},"uagb_author_info":{"display_name":"Achraf Othman","author_link":"https:\/\/achrafothman.net\/site\/author\/achraf-othman\/"},"uagb_comment_info":0,"uagb_excerpt":"Downgrading GCC and G++ compilers in Ubuntu is mandatory to build some packages (like IRSTLM, Giza++, Moses, etc.). In this tutorial, I will present an easy way to install gcc-4.4, gcc-4.6, gcc-4.9, g++-4.4, g++-4.6, and, g++-4.9. First of all, you need to update the sources repository using a text editor like vi as follow: vi","jetpack_shortlink":"https:\/\/wp.me\/p8KjJN-7V","jetpack-related-posts":[{"id":235,"url":"https:\/\/achrafothman.net\/site\/how-to-install-moses-statistical-machine-translation-in-ubuntu\/","url_meta":{"origin":491,"position":0},"title":"How to install Moses (Statistical Machine Translation) on Ubuntu?","date":"November 27, 2017","format":"image","excerpt":"In this article, I will show you how to install and build Moses on Ubuntu, and how to use Moses to translate with some simple models (English and Sign Language Gloss). If you experience problems, then please contact me. If you\u2019re just writing about this work, please cite this paper\u2026","rel":"","context":"In &quot;Tutorials&quot;","img":{"alt_text":"How to install Moses on Ubuntu? Moses, Statistical Machine Translation","src":"https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/tuto-1.jpg?fit=640%2C400&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":500,"url":"https:\/\/achrafothman.net\/site\/deployment-of-a-statistical-machine-translation-english-american-sign-language\/","url_meta":{"origin":491,"position":1},"title":"Deployment of a Statistical Machine Translation (English &#038; American Sign Language)","date":"May 17, 2020","format":false,"excerpt":"Hello! In this tutorial, you will be able to deploy your statistical machine translation for the pair of language English and American Sign Language in written form. If you want to cite my work in your research papers, please refer to this publication: Achraf Othman, Mohamed Jemni, \u201cDesigning High Accuracy\u2026","rel":"","context":"In &quot;Tutorials&quot;","img":{"alt_text":"Deployment of a Statistical Machine Translation English-American Sign Language","src":"https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/smt-tutorial.png?fit=600%2C400&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":920,"url":"https:\/\/achrafothman.net\/site\/login-form-using-python-and-kivy-gui-and-mysql-connector-tutorial\/","url_meta":{"origin":491,"position":2},"title":"Login Form using Python and Kivy GUI and MySQL Connector (Tutorial)","date":"August 7, 2021","format":false,"excerpt":"Hello!\u00a0In this tutorial, I will develop a GUI using Python, Kivy, KivyMD, and MySQL. Kivy is a graphical user interface opensource Python library that allows you to develop multi-platform applications on Windows, macOS, Android, iOS, Linux, and Raspberry-Pi. In addition to the regular mouse and keyboard inputs, it also supports\u2026","rel":"","context":"In &quot;Tutorials&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/t3.png?fit=996%2C782&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":175,"url":"https:\/\/achrafothman.net\/site\/virtual-conversation-agent-avatar-for-sign-language\/","url_meta":{"origin":491,"position":3},"title":"Virtual Conversational Agent (avatar) for Sign Language","date":"July 16, 2017","format":"image","excerpt":"Sign language (SL) was first acknowledged as a separate language only in the 1960s. Similar to spoken language, it evolved from different cultural backgrounds. Every country has its own sign language with various dialects, which are based on different rules than the spoken language. Although several websites provide video clips\u2026","rel":"","context":"In &quot;Blog&quot;","img":{"alt_text":"Virtual Conversation Agent (avatar) for Sign Language","src":"https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/Capture.png?fit=848%2C514&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3295,"url":"https:\/\/achrafothman.net\/site\/social-robots-and-their-relationship-with-autism-children-2\/","url_meta":{"origin":491,"position":4},"title":"Nafath 21 by Mada Center is published","date":"November 24, 2022","format":false,"excerpt":"Authors: Achraf Othman Research and Innovation Letters \u2022 Volume 1 \u2022 November 2022 \u2022 Published: November 24, 2022 What is Nafath newsletter? Nafath aims to be a key information resource for disseminating the facts about latest trends and innovation in the field of ICT Accessibility. It is published in English\u2026","rel":"","context":"In &quot;Research and Innovation Letters&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/achrafothman.net\/site\/wp-content\/uploads\/nafath-21.jpg?fit=1200%2C630&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/posts\/491"}],"collection":[{"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/comments?post=491"}],"version-history":[{"count":4,"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/posts\/491\/revisions"}],"predecessor-version":[{"id":495,"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/posts\/491\/revisions\/495"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/media\/496"}],"wp:attachment":[{"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/media?parent=491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/categories?post=491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/achrafothman.net\/site\/wp-json\/wp\/v2\/tags?post=491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}