To uninstall OpenCV installed via APT: sudo apt remove --purge libopencv-dev python3-opencv To remove a source installation, you would need to delete the build and install directories manually.