Manually Uninstall GDAL

I followed a ./configure, make, make install approach when I originally installed GDAL on my Ubuntu machine, but now I want to upgrade to 1.10.

Unfortunately, I want to use apt to perform the upgrade, but after performing an apt-get install I run gdal-config --version I still get a version of 1.9.

I've tried manually renaming the .so files in /usr/local/lib and /usr/lib but I still am unable to manually uninstall GDAL.

Has anyone else had success doing this?


Solution 1:

I don't know if this will help, but it worked out for me. I was looking to upgrade GDAL, and since I had installed it manually from source, I wanted to uninstall the old version first. So I read somewhere (sorry but I had so many tabs open that I can't find it now) that I should just install the latest package and that would override the previous. And I read another comment saying next time instead of using sudo make install I should use sudo checkinstall which creates a deb package wich is uninstallable later running sudo dpkg -r <name_of_your_package> so I just installed the version I had with sudo checkinstall (overriding what I had, and creating the package) and then I uninstalled that using sudo dpkg -r gdal. I know it's not the most elegant thing, but it worked for me.

Solution 2:

You need to locate your manually installed binary:

$> which gdalinfo
/usr/local/bin

And then you have to locate other manually installed binaries and remove them (BEWARE BEFORE REMOVING COMMAND: you certainly have other manually installed binaries here)

$> ls /usr/local/bin
gdal-config gdal_contour gdal_grid gdal_rasterize gdal_translate gdaladdo gdalbuildvrt gdaldem gdalenhance gdalinfo gdallocationinfo gdalmanage gdalserver gdalsrsinfo gdaltindex gdaltransform gdalwarp ogr2ogr ogrinfo ogrlineref ogrtindex

When you manually install GDAL, you also install local lib, they should be here: /usr/local/lib/ with the libgdal* wildcard and inside gdalplugins. You'll want to remove them also.