Repairing broken GDAL and PROJ.4 on Ubuntu?

In https://gis.stackexchange.com/questions/158457/gdal2tiles-how-to-make-filenames-of-tiles-to-represent-xyz-coordinates, somebody mentions doing:

sudo ln -s /usr/lib/libproj.so.0 /usr/lib/libproj.so

Which absolutely fixed the same error (ERROR 6: Unable to load PROJ.4 library (libproj.so)) for me.


On the x86_64 architecture you may need to use this variation:

sudo ln -s /usr/lib64/libproj.so.0 /usr/lib/libproj.so

After several wrong ways, including multiple reinstall of libproj0 package and even installing QGIS from sources different from the Ubuntu Software Center default (I think it's from the official QGIS repository - http://qgis.org/debian trusty main), I understood how to apply advice by @EvilGenius: ldd ogrinfo didn't show libproj no matter how many times I used sudo ldconfig, until I typed:

export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib

Since then, the library is read normally.


Try:

sudo apt-get install libproj-dev

It solved the same error for me when using gdal_translate for extracting bands from an hdf image.