Installing QGIS on Centos 6?

You'd have to install the repository first

sudo rpm -Uvh http://elgis.argeo.org/repos/6/elgis-release-6-6_0.noarch.rpm

Then to install QGIS

sudo yum install qgis qgis-python qgis-grass qgis-mapserver

or try this

sudo yum --enablerepo=elgis install qgis qgis-grass qgis-python qgis-mapserver

If that still doesn't work, could you try searching for it in the repository?

su -c 'yum search qgis'

and see what the actual package names are.


If you're willing to do the compiling yourself, then you might follow my instructions here. (EDIT: pasted to avoid linkrot)

We’ll assume you already have a build environment with gcc-c++, flex, bison, PyQt4 etc. Check the QGIS wiki wiki page for details regarding dependencies. While the instructions are specific for Ubuntu systems, it’s fairly clear which parallel packages you will need to install on SL6. Also you will want to install the whole geospatial stack, all from standard repos or the EPEL and elgis repos. This includes geos, proj, grass-6.4.2, gdal-1.8.1 and all the -devel packages as well.

Download the source code for QGIS and untar in a directory of your choice. Before starting the configure and make steps there’s one simple edit required for EL6 and similar: under the python directory open the file CMakeLists.txt. You’ll find four lines like:

SET(SIP_EXTRA_OPTIONS ${PYQT4_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/qgis.core.api)

These are lines 64, 80, 94, 100

You need to remove the “-o” option from each. This is a flag for “sip” which handles bindings between c++ and python. This new flag was introduced in recent versions of sip, and it’s not available in the EL6 sip packages. Removing the extra flag has no ill effects on the compilation (I believe it’s only applicable to the comments in the source code). So each of the four lines should be:

SET(SIP_EXTRA_OPTIONS ${PYQT4_SIP_FLAGS} -a ${CMAKE_BINARY_DIR}/python/qgis.core.api)

If you prefer to make the above changes with ‘patch’ here’s a diff file provided by Volker Froehlich (Fedora GIS maintainer). Now, following more or less the instructions from that same wiki page above, you create a subdirectory “build’, drop into that directory and run:

$ cmake -L -DGRASS_PREFIX=/usr/grass-6.4.2 -DGDAL_LIBRARY=/usr/lib64/libgdal.so ..

(Don’t skip the two dots .. at the end of the command)

The two specific directives to the cmake command indicate where the GRASS installation and libgdal are. These paths are based on GRASS and GDAL being installed from RPM’s. If you’ve cooked your own GRASS or GDAL, set the above appropriately. Now you’re ready to go:

$ make
$ sudo make install

One more step is required so that QGIS can “find” the GRASS libraries. Add a one line file into /etc/ld.so.conf.d which contains:

$ cat /etc/ld.so.conf.d/grass.conf
/usr/grass-6.4.2/lib

and do: sudo ldconfig

Now you should be ready to enjoy the new, updated QGIS 1.8.0 ‘Lisboa’

It's for Scientific Linux 6, but should be identical on CentOS 6.