This question is similar to How to have PostGIS 2.1 and the Python osgeo library installed together without compiling from source?
but I couldn't figure out how to ask a follow-up question.
I am trying to get PostgreSQL + PostGIS + MapServer + Python-MapScript working on Ubuntu 12.04 LTS, for a Geo-Django site. In the past, this has worked wonderfully (was still working in April of 2014), however something has changed, and I'm now getting an error regarding gdal compatibility:
The following packages have unmet dependencies: postgresql-9.1-postgis : Depends: libgdal1 (>= 1.9.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
After a fair bit of searching, I came across Brian (cokrzys)'s answer to the post above. I followed his instructions on a clean install of Ubuntu 12.04, and was subsequently able to create the PostGIS templates in PostgreSQL 9.3. However, when I then try to install python-mapscript, I get the following message:
The following packages will be REMOVED: libgdal1 postgis postgresql-9.3-postgis-2.1
So, the problem is that it does not appear that I can have both the postgis libraries and the python-mapscript libraries installed at the same time.
Honestly, I don't care what version of PostgreSQL / PostGIS / MapServer I use, so long as I can get it running on Ubuntu 12.04.
Has anyone had any luck with this?
@Mark helped me to finally got this working as follows:
#!/usr/bin/env bash
###################################################################
# Install GDAL, MapServer, etc. first
###################################################################
echo "Y" | sudo apt-get install python-software-properties
echo "Y" | sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
echo "Y" | sudo apt-get install mapserver-bin
echo "Y" | sudo apt-get install gdal-bin
echo "Y" | sudo apt-get install cgi-mapserver
echo "Y" | sudo apt-get install python-gdal
echo "Y" | sudo apt-get install python-mapscript
echo "Y" | sudo apt-get install python-gdal
###################################################################
# Then Install PostgreSQL9.1, PostGIS 9.1
###################################################################
echo "Y" | sudo apt-get install postgresql-9.1
echo "Y" | sudo apt-get install postgresql-client-9.1
echo "Y" | sudo apt-get install postgresql-server-dev-9.1
echo "Y" | sudo apt-get install postgresql-plperl-9.1
echo "Y" | sudo apt-get install postgresql-9.1-postgis-2.0
echo "Y"
you can just use the-y
flag on apt-get and apt-add. For instancesudo apt-get install -y python-software-properties
. This will also prevent prompts.