In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to install multi-version GCC compiler in Ubuntu18.04 LTS system". In daily operation, I believe many people have doubts about how to install multi-version GCC compiler in Ubuntu18.04 LTS system. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the question of "how to install multi-version GCC compiler in Ubuntu18.04 LTS system". Next, please follow the editor to study!
GCC is a compiler developed by GNU and specially written for GNU operating system. The GNU compiler suite includes C, C++, Java, Ada and Go language front ends.
This article applies to both Ubuntu 16.04 and any Ubuntu-based distribution, including Kubuntu, Linux Mint, and Elementary OS.
Install the GCC compiler in Ubuntu 18.04
The default Ubuntu repository contains a collection of packages called build-essential, which contains the GCC compiler and many of the libraries and other utilities needed to compile the software.
You can install the GCC compiler in Ubuntu 18.04 simply by performing the following steps:
1 in Terminal, execute the following command to update the package list:
Sudo apt update
2 execute the following command to install the build-essential package collection:
Sudo apt install build-essential
The above command installs a range of software, including gcc, G + + and make.
You can also install the development manual for GNU/Linux using the following command:
Sudo apt install manpages-dev
3 to verify that the GCC compiler has been successfully installed, check the GCC version using the following command:
Gcc-version
Install multiple versions of the GCC compiler
However, newer versions of GCC compilers include support for new languages, better performance, and extensions, so here's how to install and use multiple versions of the GCC compiler on Ubuntu 18.04 systems.
(as of this writing) the default Ubuntu repository includes multiple versions of GCC from 5.x.x to 8.x.x, while the latest version of GCC is 9.1.0, available from Ubuntu Toolchain PPA.
In the following example, we will install the latest three versions of GCC and Gateway packages:
1 add ubuntu-toolchain-r/test PPA to the Ubuntu system using the following command:
Sudo apt install software-properties-commonsudo add-apt-repository ppa:ubuntu-toolchain-r/test
2 execute the following command to install the required GCC and G + versions:
Sudo apt install gcc-7 gong Mui 7 gcc-8 gong Mui 8 gcc-9 gong Yu Mui 9
The following command will configure an alternative for each version and associate the priority with it, and the default version is the version with the highest priority, which in our case is gcc-9:
Sudo update-alternatives-- install / usr/bin/gcc gcc / usr/bin/gcc-9 90-- slave / usr/bin/g++ gathers + / usr/bin/g++-9sudo update-alternatives-- install / usr/bin/gcc gcc / usr/bin/gcc-8 80-- slave / usr/bin/g++ gathers + / usr/bin/g++-8sudo update-alternatives-- install / usr/bin/gcc gcc / usr/bin/gcc-7 70-- slave / usr/bin/g++ gathers + / usr/bin/g++-7
3 if you want to change the default version, you can use the update-alternatives command:
Sudo update-alternatives-config gcc
The above command automatically creates symbolic links to specific versions of GCC and G +.
At this point, the study on "how to install multiple versions of GCC compilers in Ubuntu18.04 LTS systems" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.