How to Properly Uninstall Software Installed via make install on CentOS 6.2: A Comprehensive Guide for OCILIB and Similar Packages


2 views

When dealing with software installed through the classic ./configure && make && make install process, uninstallation becomes a manual process since no package manager (like RPM or Yum) tracks these files. This is particularly common with libraries like OCILIB that are compiled from source.

Most well-behaved Makefiles include an uninstall target. Try:

# cd /path/to/oci/source
# make uninstall

If this works, you're done. But when (as in our case) this target doesn't exist, we need manual approaches.

The smart approach is to record file installations during make install. For future installations, consider:

# make install DESTDIR=/tmp/oci-install
# find /tmp/oci-install -type f > oci_files.txt
# cp -r /tmp/oci-install/* /

This gives you an uninstall manifest. For current cases, we'll need to reconstruct this.

Based on standard Unix conventions and OCILIB's documentation, these are the typical locations to check:

# Common locations to remove:
rm -f /usr/local/lib/libocilib*
rm -f /usr/local/include/ocilib.h
rm -f /usr/local/bin/oci_*

# Also check these Oracle-specific paths:
rm -f /usr/lib/oracle/11.2/client64/lib/libocilib*

For future source installations, use installwatch to track file operations:

# yum install ltrace
# installwatch -o install.log make install

This creates a log of all installed files for easy removal later.

Before uninstalling, check what depends on OCILIB:

# ldd /usr/bin/your_program | grep ocilib
# updatedb
# locate libocilib

This helps avoid breaking dependent applications.

After uninstallation, verify with:

# updatedb
# locate ocilib | grep -v source
# ldconfig -p | grep ocilib

These commands should return empty results if uninstallation was successful.

When installing the new version, consider using checkinstall instead of make install:

# yum install checkinstall
# ./configure [your options]
# make
# checkinstall

This creates an RPM package that can be cleanly uninstalled later.


When dealing with software compiled from source using the standard ./configure, make, make install sequence, you're left without package manager tracking. Unlike RPM or DEB packages, these installations don't register with yum/rpm, making uninstallation non-trivial.

The most reliable method is to examine the Makefile for uninstall targets. For OCILIB specifically:

# Navigate to original source directory
cd /path/to/ocilib-source

# Check for uninstall target
make -n install  # Shows what files were installed
make -n uninstall  # If available

If no uninstall target exists, you'll need to manually track installed files:

# Common installation locations to check
find /usr/local/lib -name "*ocilib*"
find /usr/local/include -name "ocilib*"

# Typical library paths
ls -l /usr/local/lib/libocilib*

Since OCILIB links with Oracle libraries, you may want to verify linkage:

ldd /usr/local/lib/libocilib.so | grep oracle

For a typical OCILIB installation:

# Remove libraries
sudo rm -f /usr/local/lib/libocilib.*

# Remove headers
sudo rm -rf /usr/local/include/ocilib

# Remove pkg-config files if present
sudo rm -f /usr/local/lib/pkgconfig/ocilib.pc

# Clean up documentation
sudo rm -rf /usr/local/share/doc/ocilib

Consider using checkinstall instead of make install for better tracking:

sudo yum install checkinstall
./configure
make
sudo checkinstall

After uninstallation, verify no traces remain:

updatedb
locate ocilib | grep -v "source.*ocilib"