Software⏱️ 3 min read📅 2026-06-04

How to Fix: Error: gdal-config not found while installing R dependent packages whereas gdal is installed

R package installation issue with missing gdal-config script.

Quick Answer: Check if GDAL is installed and its configuration files are in the system's PATH.

Error: gdal-config not found while installing R dependent packages can be frustrating, especially when you have already installed GDAL. This error occurs because the system cannot find the gdal-config script distributed with GDAL.

This issue affects users who are trying to install the rgdal package in R, which depends on GDAL. The inability to locate the gdal-config script prevents the installation process from continuing.

🔍 Why This Happens

  • The primary reason for this error is that the system cannot find the gdal-config script distributed with GDAL. This can happen if GDAL is not installed correctly or if the installation path is not properly set up.
  • Another possible cause is that the gdal-config script is not available in the system's PATH environment variable. This could be due to a misconfigured package manager or an incorrect installation of GDAL.

🛠️ Step-by-Step Verified Fixes

Install GDAL and set the correct path

  1. Step 1: Step 1: Install GDAL using the package manager for your system. For openSUSE, you can use the following command: sudo zypper install libgdal-dev.
  2. Step 2: Step 2: Once the installation is complete, update the PATH environment variable to include the location of the gdal-config script. You can do this by running the following command: export PATH=/usr/lib64/GDAL:$PATH
  3. Step 3: Step 3: After setting the correct path, try reinstalling the rgdal package using the original command: sudo R CMD INSTALL rgdal_0.7-12.tar.gz

Install GDAL and set the correct path manually

  1. Step 1: Step 1: Install GDAL using the package manager for your system. For openSUSE, you can use the following command: sudo zypper install libgdal-dev.
  2. Step 2: Step 2: Download the gdal-config script from the official GDAL website or a trusted source and save it to a location on your system. This could be in the /usr/lib64/GDAL/ directory.

✨ Wrapping Up

To resolve the Error: gdal-config not found while installing R dependent packages, follow one of the primary fix methods outlined above. By installing GDAL correctly and setting the correct path, you should be able to successfully install the rgdal package in R.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions