I'm newbie with Linux and QGIS. I'm using Ubuntu 18.04 LTS and QGIS 3.0 Girona and I can't do mosaic from a raster pile because the following log error message returns:

 Processing algorithm… AlgorithmDialog Input parameters: { 'DATA_TYPE'
 : 2, 'INPUT' : '', 'NODATA_INPUT' : 0, 'NODATA_OUTPUT' : 0, 'OPTIONS'
 : '', 'OUTPUT' :
 'PCT' : False, 'SEPARATE' : False }

 GDAL command: gdal_merge.py -n 0 -a_nodata 0 -ot UInt16 -of GTiff -o
 --optfile /tmp/processing_b9cc3491592e4af584caddae75abe2cf/mergeInputFiles.txt
 GDAL command output: /bin/sh: 1: gdal_merge.py: not found

 Execution completed in 0.02 seconds Results: {'OUTPUT':
 'createOptions': {'fileEncoding': 'System'}}>}

I presume that the gdal_merge.py isn't installed or activated. How can I fix this problem?

OBS.: Maybe other GDAL functions have the same problem, but I have not tried yet.

  • How are you calling GDAL_Merge? It's a python script, not an executable, so it needs more system paths set; I'm not sure how to do that in Linux but it's looking for the script file and can't find it so your search path needs to be updated; on Windows QGIS is started by a script (batch file) that sets the system paths, you may need to find your QGIS script and edit it so that it can locate the merge script and also python and GDAL python bindings. May 20, 2018 at 23:03
  • Please edit your question to specify how you installed QGIS 3.
    – user2856
    May 21, 2018 at 1:22
  • Luke, I followed the instructions of this page: qgis.org/en/site/forusers/alldownloads.html#debian-ubuntu May 23, 2018 at 9:58
  • In the sources list I added these two lines: deb qgis.org/debian bionic main and deb-src qgis.org/debian bionic main. Next, I followed these steps: sudo apt-get update sudo apt-get install qgis python-qgis qgis-plugin-grass. As apparently there were no keyserver errors, so I stopped at these steps. May 23, 2018 at 10:07
  • I'm having the same issue and probably used the same installation procedures. Did you ever resolve this?
    – Debaser
    Sep 16, 2018 at 15:37

4 Answers 4


I had same problem on QGIS 3.10 on LinuxMint/Ubuntu 18.04

/bin/sh: 1: gdal_merge.py: not found

I solved this issue by installing the additional package: python-gdal

 sudo apt install python-gdal
  • This solution seems to be obsolete. I get the following message: Package python-gdal is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: gdal-bin E: Package 'python-gdal' has no installation candidate
    – Sytze
    Oct 12, 2021 at 10:09

I recently had the same problem in Fedora and I solved it by installing gdal-python-tools (python-gadl does not seem to provide gdal_merge.py)

  • Unable to locate package gdal-python-tools; It's not working. I have updated the repo but still get the same error. Jan 10 at 16:42
  • 1
    Thanks for the comment, I forgot to mention that I was using Fedora. I edit it already
    – MaC
    Jan 11 at 22:20
  • Also works for me on Fedora 38 and QGIS 3.28.10-Firenze Sep 20 at 11:38

The solution that worked for me:

apt install gdal-bin

Test it by simply typing gdal_merge.py on the terminal and it'll show you how to use the utility.

  • 2
    Just saying that repeating the question in the answer as well as stating that the other answers dont work for you is not necessary ;)
    – MrXsquared
    Jan 10 at 16:52

In Ubuntu go to synaptic and install python-gdal and python3-gdal

  • 1
    Welcome to the GIS Stack Exchange site, thank you for providing an answer to an unanswered question. When providing an answer please try and include as much information as possible to allow for someone to follow the instructions given. Please take the tour: gis.stackexchange.com/tour of the site it will provide some guidance on how best to provide an answer. Oct 8, 2018 at 1:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.