What are the steps to install gcc on Linux?
The steps to install GCC (GNU Compiler Collection) are as follows:
- Open the terminal window.
- Install dependencies for GCC (such as C and C++ libraries):
- Run the following commands on Debian or Ubuntu:
sudo apt-get update
sudo apt-get install build-essential - Run the following command on Fedora or Red Hat: sudo dnf install @development-tools
- Check if GCC is installed.
- Run the following command to check if GCC is installed: gcc –version.
- If GCC is not installed, run the following command to install:
- Run the following command on Debian or Ubuntu: sudo apt-get install gcc.
- Run the following command on Fedora or Red Hat: sudo dnf install gcc.
- After installation is complete, run the following command again to verify the installation of GCC:
- What is the version of gcc?
These steps will install GCC and ensure that it is successfully installed and configured.