Install GCC Offline on Linux: Complete Guide
You can offline install GCC on Linux by following these steps:
- Download the GCC source code package (in tar.gz format) on another device connected to the internet and then copy it to the target Linux device.
- Unzip the source code package on the target Linux device. Use the following command in the terminal:
- Extract the gcc-x.x.x.tar.gz file using the command tar -zxvf.
- Navigate to the decompressed GCC source code directory. Use the following command in the terminal:
- Change directory to gcc-x.x.x.
- Create a directory for building GCC. Use the following command in the terminal:
- Create a directory named “build” and navigate into it.
- Run the configure command to set up the build. Use the following command in the terminal:
- Set up the configuration with the installation path as /usr/local/gcc.
- Run the make command to start building GCC. Use the following command in the terminal:
- create
- Install GCC as root user in the terminal using the following command:
- Execute the “make install” command with elevated privileges.
- After the installation is complete, you can find the GCC executable file in the /usr/local/gcc/bin directory.
Please note that offline installation of GCC may require fulfilling its dependencies, and you may need to download and install the offline packages of these dependencies.