Score:2

Recover opencv2/ opencv4 folders from /usr/include

cn flag

I had a lot of problems with my opencv installation and along the way I accidentally deleted the opencv folders in /usr/include. How can I recover them in the right way so that the following error doesn't occur when I try to catkin_make my ros workspaces?

-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at /opt/ros/noetic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:113 (message):
  Project 'cv_bridge' specifies '/usr/include/opencv4' as an include dir,
  which is not found.  It does neither exist as an absolute directory nor in
  '${{prefix}}//usr/include/opencv4'.  Check the issue tracker
  'https://github.com/ros-perception/vision_opencv/issues' and consider
  creating a ticket if the problem has not been reported yet.
Call Stack (most recent call first):
  /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  LeGO-LOAM/LeGO-LOAM/CMakeLists.txt:8 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/lukas/workspace/catkin_ws_legoloam/build/CMakeFiles/CMakeOutput.log".
See also "/home/lukas/workspace/catkin_ws_legoloam/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:320: cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

Would it be possible to copy the folders from /usr/local/include to /usr/include since I have those left from the successful installation or will that lead to problems?

N0rbert avatar
zw flag
What is your Ubuntu version?
cn flag
My ubuntu version is 20.04
Score:1
zw flag

You have to simply use the power of APT to restore /usr/include folder contents:

sudo apt-get install --reinstall \
$(dpkg -S /usr/include/ | sed "s/,//g" | sed "s|: /usr/include||")

The /usr/local/include folder is not controlled by APT, so its restore is not possible by using above command.

cn flag
Thank you, that worked. The power of APT is awesome!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.