1

I am working with Ubuntu 14.04. I wanted to upgrade to the latest version of OpenCV and following some other posts, executed following command to remove the previous version sudo find / -name "*opencv" -exec rm -irf {} \; Next, when I tried to run sudo apt-get install libopencv-dev I get

Reading package lists... Done       
Building dependency tree
Reading state information... Done
libopencv-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

But, when I search for libopencv using sudo find /-name "libopencv*" I cannot find any installed packages. How do I get around this issue ?

2
  • What other posts did you follow? it's generally a bad idea to manually remove files that were installed by the package manager Nov 17, 2015 at 16:47
  • This is one of the posts - link
    – Shree
    Nov 17, 2015 at 21:37

1 Answer 1

0

It looks like you already have it installed.

If you want to remove something you installed just run

sudo apt-get remove libopencv-dev

then you can install a new version

sudo apt-get install libopencv-dev

It is also pretty easy to compile from source and then you always know where it is located and you can manage versions and build parameters.

If you want to compile opencv it is pretty easy

sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip

then get opencv 3 which is the latest version

mkdir opencv
cd opencv
wget https://github.com/Itseez/opencv/archive/3.0.0.zip
unzip opencv-3.0.0.zip

then compile

cd opencv-3.0.0
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
make -j $(nproc)
sudo make install

You can also use ccmake .. if you want to configure the options a slightly easier way. Then at that point just point your include path to your build directory, or your make install directory which should be /opt/opencv I believe.

2
  • In that case, shouldn't I be able to find the packages when I execute a sudo find \ -name "libopencv*". Also, can you please add more details regarding how to compile libopencv-dev from source ?
    – Shree
    Nov 17, 2015 at 21:39
  • It won't be there if you already deleted the files.
    – Goddard
    Nov 17, 2015 at 21:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .