In this article, we will have explained the necessary steps to install and configure GCC Compiler on Ubuntu 20.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.
GCC or GNU Compiler Collection is released by the Free Software Foundation and as the name suggests, it is a very useful collection of programming compilers such as C, C++, Objective-C, Objective-C++, Fortran, Java, Go and Ada. Many open source projects including the GNU tools and the Linux kernel are compiled with GCC.
Install GCC Compiler on Ubuntu 20.04
Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.
Step 2. Install GCC Compiler on Ubuntu.
So installing the GCC compiler on Ubuntu is as simple as installing build-essential package:
Once the installation is complete, you can verify the version by typing:
# gcc --version
Step 3. Test Compiling.
To test a compiling, Let’s create a small program. Open your nano text editor and create the following file:
Save it as welcome.c and compile it using following command:
That’s all you need to do to install GCC on Ubuntu 20.04 LTS Focal Fossa. I hope you find this quick tip helpful. Don’t forget to share your valuable queries/suggestions in the below comment box & also drop your worthwhile feedback.