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.