18

I want to integrate OpenCV with qt creator and for that OpenCV 3.0 is required.

I have OpenCV 2.4.9 already installed and want to uninstall it completely as it is causing problems in some functions. I would also like to know whether OpenCV 3.0 can be installed in 32-bit Ubuntu 14.04?

Naman Sogani
  • 347
  • 1
  • 4
  • 12
  • 1
    How did you install it? presumably not from the standard repository since 14.04 uses OpenCV-2.4.8 – steeldriver Dec 22 '14 at 13:50
  • I downloaded it from opencv.org and it was installed perfectly after installing all the dependencies and it is working perfectly fine.But now I require OpenCV 3.0 and for that I need to uninstall this older version. – Naman Sogani Dec 22 '14 at 17:09

5 Answers5

20

I had a similar issue, but with version 2.4.8, I found this solution:

"So, to find all OpenCV libraries 1

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

The above command will find any file containing opencv in the name, and will prompt you to remove it. As always, be careful when deleting things manually! That will take a hell of long time. Next I figure out that since I installed from compiling opencv from the source and used

make install

to create the install manifest, and then I pretty simple to use

make uninstall

Yes indeed it for sure clean up itself. Now I have a clean system to install the lates opencv release."

Works for me.

Elod
  • 383
  • 2
  • 12
  • Although your answer is 100% correct, it might also become 100% useless if that link is moved, changed, or the main site just disappears... :-( Therefore, please [edit] your answer, and copy the relevant steps from the link into your answer, thereby guaranteeing your answer for 100% of the lifetime of this site! ;-) You can always leave the link in at the bottom of your answer as a source for your material... – Fabby Jan 30 '15 at 13:03
  • thx for the observation – Elod Jan 30 '15 at 13:14
  • And an upvote! +10 reputation! ;-) – Fabby Jan 30 '15 at 13:16
  • I am facing a similar situation. I ran that command and I deleted 10 or so libraries. The process ended in less that half a minute. Furthermore do all the libraries contain "opencv" in their title? – Adam May 06 '15 at 17:59
  • If I know well, yes all library files have "opencv" in their name. You can double check by listing them: `pkg-config --libs opencv`. – Elod Dec 02 '15 at 10:30
  • Is there a modification to prevent prompting for confirmation? `rm: remove regular file '/usr/local/lib/libopencv_stitching.so.2.4.13'?` – Klik Feb 16 '17 at 17:37
  • 2
    Nvm. Figured it out: `sudo find / -name "*opencv*" -exec rm -R {} \;` worked for me to prevent prompts – Klik Feb 16 '17 at 17:38
14

This may be an easier way to go:

sudo apt-get autoremove opencv-doc opencv-data libopencv-dev libopencv2.4-java libopencv2.4-jni python-opencv libopencv-core2.4 libopencv-gpu2.4 libopencv-ts2.4 libopencv-photo2.4 libopencv-contrib2.4 libopencv-imgproc2.4 libopencv-superres2.4 libopencv-stitching2.4 libopencv-ocl2.4 libopencv-legacy2.4 libopencv-ml2.4 libopencv-video2.4 libopencv-videostab2.4 libopencv-objdetect2.4 libopencv-calib3d2.4 
Paul Gregoire
  • 523
  • 6
  • 14
  • 2
    Seems this command more simple `sudo apt-get autoremove opencv-data ` I tried it with opencv 2.4.9 and ubuntu 14.04 , seems it delete everything I checked it with `dpkg --get-selections | grep -v deinstall | grep opencv`. – mrgloom Apr 11 '16 at 12:31
1

Use the synaptic package manager to remove all opencv libraries from your machine.

Haresh K
  • 11
  • 2
1
yes | sudo find / -name "*opencv*" -exec rm -i {} \;

is the command I used if long time process is to be skipped.

Essentially it was asked in the comment and I could not repply to comment due to reputaions <50 as I am unable to login my account. Caution: The command contains sudo and it finds all the files with name opencv and deletes it. As the process:

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

prompts for your permission for deleting any file, it takes a lot time.

yes | 

just automatically inputs yes for all prompts.

Caution: Its dangerous and only recommended for those who can bear any potential file loss! It was asked, so I answered.

0

This worked for me:

sudo apt remove libopencv*