Install GCC Offline on Linux: Complete Guide

You can offline install GCC on Linux by following these steps:

  1. 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.
  2. Unzip the source code package on the target Linux device. Use the following command in the terminal:
  3. Extract the gcc-x.x.x.tar.gz file using the command tar -zxvf.
  4. Navigate to the decompressed GCC source code directory. Use the following command in the terminal:
  5. Change directory to gcc-x.x.x.
  6. Create a directory for building GCC. Use the following command in the terminal:
  7. Create a directory named “build” and navigate into it.
  8. Run the configure command to set up the build. Use the following command in the terminal:
  9. Set up the configuration with the installation path as /usr/local/gcc.
  10. Run the make command to start building GCC. Use the following command in the terminal:
  11. create
  12. Install GCC as root user in the terminal using the following command:
  13. Execute the “make install” command with elevated privileges.
  14. 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.

bannerAds