Ubuntu – Postgis + could not access file “$libdir/postgis-2.1”: No such file or directory

postgresql

I am running postgresql9.3 and postgis2.1 , it works fine. When i installed QGIS by using the following commands:

sudo apt-get update
sudo apt-get install qgis

After installing QGIS the postGis is not working. When i tried to execute a spatial query, it shows error:

 could not access file "$libdir/postgis-2.1": No such file or directory

SO i uninstalled QGIS , but now also i get the same error. I searched a lot regarding this, i cant find the solution. Help me to solve this. Thanks in advance..

Best Answer

You can reinstall the postgis extension for PostgreSQL, it worked for me :

sudo apt-get install postgresql-9.3-postgis-2.1