opencvmakefileuninstallationopencv-contrib

Failed OpenCV install unable to uninstall


While installing opencv_contrib (during make -j5 step), my laptop went to sleep and gave errors on the install, failing with a fatal error. Retrying make -j5 gave the same error again. trying to uninstall opencv completely using make uninstall also completely fails with a fatal error.

How do I do a fresh install of OpenCV from here?

Error on running make uninstall:

-- Uninstalling "/usr/local/include/opencv2/cvconfig.h"
CMake Error at cmake_uninstall.cmake:20 (MESSAGE):
  Problem when removing "/usr/local/include/opencv2/cvconfig.h"


CMakeFiles/uninstall.dir/build.make:57: recipe for target 
'CMakeFiles/uninstall' failed
make[3]: *** [CMakeFiles/uninstall] Error 1
CMakeFiles/Makefile2:296: recipe for target 
'CMakeFiles/uninstall.dir/all' failed
make[2]: *** [CMakeFiles/uninstall.dir/all] Error 2
CMakeFiles/Makefile2:303: recipe for target             
'CMakeFiles/uninstall.dir/rule' failed
make[1]: *** [CMakeFiles/uninstall.dir/rule] Error 2
Makefile:234: recipe for target 'uninstall' failed
make: *** [uninstall] Error 2

Solution

  • You should try make clean and try to uninstall again. Also you should restart from previous steps for opencv installing