How To Install gcc on AlmaLinux 8

In this tutorial we learn how to install gcc in AlmaLinux 8. gcc is Various compilers (C, C++, Objective-C, …)

Introduction

In this tutorial we learn how to install gcc on AlmaLinux 8.

What is gcc

The gcc package contains the GNU Compiler Collection version 8. You’ll need this package in order to compile C code.

We can use yum or dnf to install gcc on AlmaLinux 8. In this tutorial we discuss both methods but you only need to choose one of method to install gcc.

Install gcc on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install gcc using dnf by running the following command:

sudo dnf -y install gcc

Install gcc on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install gcc using yum by running the following command:

sudo yum -y install gcc

How To Uninstall gcc on AlmaLinux 8

To uninstall only the gcc package we can use the following command:

sudo dnf remove gcc

References

Summary

In this tutorial we learn how to install gcc on AlmaLinux 8 using yum and dnf.