8

I am trying to install OpenCV in CentOS 6. When I run the command

[root@cosmas opt]# sudo yum install libtiff4-dev libjpeg-dev libjasper-dev

it returned the follow:

Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * epel: mirror.fraunhofer.de
 * rpmforge: nl.mirror.eurid.eu
Setting up Install Process
No package libtiff4-dev available.
No package libjpeg-dev available.
No package libjasper-dev available.
Error: Nothing to do

What I am doing wrong? Can anyone help me?

Scott
  • 1,683

3 Answers3

13

I just did the same install on CentOS 6. Since the install instructions are more geared toward Ubuntu, here is what I was able to do to install it:

  1. install all the required packages using yum

    yum groupinstall "Development Tools" 
    yum install gcc 
    yum install cmake 
    yum install git
    yum install gtk2-devel
    yum install pkgconfig 
    yum install numpy 
    yum install ffmpeg
    
  2. Create working directory and check out the source code [note: You probably don't want to use the tag below anymore as it is a significantly old version. I had to use that version due to my software requiring it.]

    mkdir /opt/working
    cd /opt/working
    git clone https://github.com/Itseez/opencv.git
    cd opencv
    git checkout tags/2.4.8.2
    
  3. Create the Makefile

    mkdir release
    cd release
    cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
    
  4. If using cmake version 2.6-patch 4 (check with cmake --version), then you'll need to comment out a line in the build. Comment out string(MD5 hash "${lines}") on line 50 in /opt/working/opencv/cmake/cl2cpp.cmake. Other options (including updating cmake) can be found at here.

  5. Build and install

    cd /opt/working/opencv/release
    make
    make install
    
Scott
  • 1,683
2

sudo yum search all --enablerepo=epel libtiff4-dev libjpeg-dev libjasper-dev

Gives-

libjpeg-devel.x86_64 : Development tools for programs which will use the libjpeg library
Warning: No matches found for: libtiff4-dev
Warning: No matches found for: libjasper-dev

Which makes me think that you have wrong package names. Are you sure that these aren't debian package names?

Anyways in the meanwhile you can install libjpeg-devel.x86_64 via-

sudo yum install --enablerepo=epel libjpeg-dev

erbdex
  • 121
  • 3
1

@Roopendra I met this error too and I tried: cp /usr/local/lib/python2.7/site-packages/cv2.so /usr/lib/python2.7/site-packages and solved it. Source: http://techieroop.com/install-opencv-in-centos/

joe
  • 11