To install GCC on Ubuntu, follow these steps:
Once the installation is complete, you can verify that GCC was installed successfully by typing
gcc --version and pressing
Enter. This should display the version of GCC that was installed.
Alternatively, you can install specific versions of GCC by installing the
gcc-X package, where
X is the version number. For example, to install GCC 8, you can type
sudo apt install gcc-8.