Ask Your Question

Uninstalling Opencv 4.0.0 to 3.4

asked 2018-06-19 15:57:00 -0500

gameon1510 gravatar image

Hello, everyone, I would like some help in uninstalling my current version of opencv to a different one. I'm fairly new to this and I would greatly appreciate a step by step tutorial on how to go about this in the quickest and least painful manner. The opencv software is running on Ubuntu 16.04 on a raspberry pi. I'm attempting to use the opencv to use facial detection via webcam. Please inform me if you need any additional information.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-06-19 18:58:57 -0500

updated 2018-06-19 19:45:29 -0500

I hope you have a folder which you run cmake command to OpenCV? In my case, I created a folder name release to put builds. open Terminal on that location (or go to that place using Terminal). Now run below command.

sudo make uninstall

After this, remove opencv and opencv_contrib folders. If above command doesn't work don't worry. Now we are going to remove symlinks manually(I suggest follow this and check to avoid tons of error while installing new one). Be careful when you are removing them. Always read fully before remove Run below command and it will prompt you all the files that have OpenCV name.

sudo find / -name "opencv" -exec rm -i {} \;

read carefully and type y and enter. If you don't want to remove type n and enter.

After above manual remove is complete please run

pkg-config --modversion opencv

If it's doesn't print a version number now OpenCV has completely removed.

Now we need to get OpenCV Release codes. I suggest using OpenCV 3.4.1 Download Source code (zip) using below command

now we need to move them to /opt folder. This process you have to go through a terminal as a Superuser. After Extract them open Terminal and example commands will be like below.

sudo mv opencv-3.4.1 /opt

sudo mv opencv_contrib-3.4.1 /opt

Now go to opencv-3.4.1 and create release folder

cd /opt/opencv-3.4.1

mkdir release

cd release

Now you have to build the OpenCV using below commands


Make sure you have correct versions on both OpenCV here I use 3.4.1 Please follow next commands.

sudo make -j4

sudo make install

sudo ldconfig

Now run below command to check installation is completed or not.

pkg-config --modversion opencv

Disclaimers - This answer provided with good deeds. If you won't be careful when manual OpenCV file removing step, you might damage your IDE or relevant software.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-06-19 15:57:00 -0500

Seen: 20,074 times

Last updated: Jun 19 '18