[GIS] Problem getting SAGA activated in Ubuntu QGIS 2.18.2
qgisqgis-processingsagaUbuntu
By some reason SAGA does not appear into Processing Toolbox list although I have checked it to be active. See screen capture. What could be the problem?
QGIS vesion is 2.18.2 and OS is Ubuntu 16.04 (Xenial).
Best Answer
Note: On 16.04, the default Ubuntu repositories for Xenial only include QGIS 2.8 Wein. The Q version we want is QGIS 2.18 Las Palmas (the current release as of the date of this post), which includes the version of the SAGA algorithm and API that the below solution works with. To remedy this situation, add the linedeb http://qgis.org/debian xenial mainto your/etc/apt/sources.listfile and follow instructions to add the public repository key, thensudo apt-get updateto get the updated source list. Then follow the steps as below.
I tried several things before I got this to work properly. First I tried both Jesus's answer and AndreJ's answer as shown below, then added my own solution. The solution I came up with ends up being kind of hacky, but it works. Some of these steps may be superfluous:
Added the line deb http://ftp.ussg.iu.edu/linux/ubuntu xenial main universe to the /etc/apt/sources.list file.
Then tell apt not to touch saga and libsaga when installing updates
$ sudo apt-mark hold saga libsaga
Reinstalled Q:
$ sudo apt-get install qgis
At this point I was still not seeing the SAGA plugin. I decided to poke around in /usr/share/qgis/python/plugins/processing/algs/saga because I was desperate. I found the following statement in /usr/share/qgis/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py beginning on line 76:
if not version.startswith('2.3.'):
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr('Problem with SAGA installation: unsupported SAGA version found.'))
return
Because the version we now have is 2.2.3, I modified line 76 to be:
if not version.startswith('2.'):
Then I restarted Q, and it works! Thank you Jesus and AndreJ for the help. Upvoted for providing a terrific lead to follow.
Best Answer
Note: On 16.04, the default Ubuntu repositories for Xenial only include QGIS 2.8 Wein. The Q version we want is QGIS 2.18 Las Palmas (the current release as of the date of this post), which includes the version of the SAGA algorithm and API that the below solution works with. To remedy this situation, add the line
deb http://qgis.org/debian xenial main
to your/etc/apt/sources.list
file and follow instructions to add the public repository key, thensudo apt-get update
to get the updated source list. Then follow the steps as below.I tried several things before I got this to work properly. First I tried both Jesus's answer and AndreJ's answer as shown below, then added my own solution. The solution I came up with ends up being kind of hacky, but it works. Some of these steps may be superfluous:
deb http://ftp.ussg.iu.edu/linux/ubuntu xenial main universe
to the/etc/apt/sources.list
file.Removed SAGA, QGIS and associated dependencies:
Installed proper SAGA version using:
Then tell
apt
not to touchsaga
andlibsaga
when installing updatesReinstalled Q:
At this point I was still not seeing the SAGA plugin. I decided to poke around in
/usr/share/qgis/python/plugins/processing/algs/saga
because I was desperate. I found the following statement in/usr/share/qgis/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
beginning on line 76:Because the version we now have is 2.2.3, I modified line 76 to be:
Then I restarted Q, and it works! Thank you Jesus and AndreJ for the help. Upvoted for providing a terrific lead to follow.