How to Uninstall Packages Built from Source in Ubuntu

compilinglibrariespackage-managementsourceuninstall

I have built a lib, Open3D, from source and installed it. Afterwards, i ran make uninstall for the library and deleted the entire file directory which i cloned from git, i still have existing files from Open3D from /usr/local/lib directory. This is frustrating. How do i completely remove all these files? I don't face such problems if the package i require can be installed from apt.

This is what i get using

ncdu

--- /usr/local/lib -------------------------------------------------------------
                         /..                                                    
  661.8 MiB [##########]  libOpen3D_3rdparty_mkl_mkl_merged.a
  661.8 MiB [##########]  libOpen3D_3rdparty_faiss_mkl_merged.a
  421.2 MiB [######    ]  libOpen3D_3rdparty_embree_embree_avx.a
  411.7 MiB [######    ]  libOpen3D_3rdparty_embree_embree3.a
  394.8 MiB [#####     ]  libOpen3D_3rdparty_embree_embree_avx2.a
  311.7 MiB [####      ]  libOpen3D_3rdparty_assimp_assimp.a
   93.0 MiB [#         ]  libOpen3D_3rdparty_ippicv_ippicv.a
   48.1 MiB [          ]  libOpen3D_3rdparty_webrtc_webrtc.a
   41.3 MiB [          ]  libOpen3D_3rdparty_faiss_faiss.a
   34.6 MiB [          ]  libOpen3D_3rdparty_zeromq.a
    6.8 MiB [          ]  libOpen3D_3rdparty_imgui.a
    6.5 MiB [          ]  libOpen3D_3rdparty_tbb_tbb_static.a
    6.5 MiB [          ]  libOpen3D_3rdparty_mkl_tbb_static.a
    6.5 MiB [          ]  libOpen3D_3rdparty_faiss_tbb_static.a
    6.1 MiB [          ]  libOpen3D_3rdparty_qhullcpp.a
    4.2 MiB [          ]  libOpen3D_3rdparty_jsoncpp.a
    3.9 MiB [          ]  libOpen3D_3rdparty_jpeg.a

Best Answer

After looking around, i managed to solve my problem. If you can build packages without building from source, do it. If not, when building your package from source, you will eventually run into having to run

make install

Instead of that, run

check install

to create a .deb package which can be easily removed with your package manager software when you want to uninstall. Doing so removes all the related files and data