2

I'm trying to install opencv on ubuntu 14.04 embedded Zynq SoC processor

linaro@linaro-nano:~$ sudo apt-get update
    Ign http://ports.ubuntu.com trusty InRelease
    Ign http://ppa.launchpad.net trusty InRelease
    Hit http://ports.ubuntu.com trusty Release.gpg
    Hit http://ppa.launchpad.net trusty Release.gpg
    Hit http://ports.ubuntu.com trusty Release
    Hit http://ppa.launchpad.net trusty Release
    Hit http://ports.ubuntu.com trusty/main Sources
    Hit http://ppa.launchpad.net trusty/main Sources
    Hit http://ports.ubuntu.com trusty/universe Sources
    Hit http://ppa.launchpad.net trusty/main armhf Packages
    Hit http://ports.ubuntu.com trusty/main armhf Packages
    Hit http://ppa.launchpad.net trusty/main Translation-en
    Hit http://ports.ubuntu.com trusty/universe armhf Packages
    Hit http://ports.ubuntu.com trusty/main Translation-en
    Hit http://ports.ubuntu.com trusty/universe Translation-en
    Reading package lists... Done
    linaro@linaro-nano:~$ sudo apt-get install pkg-config build-essential libopencv-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    build-essential is already the newest version.
    pkg-config is already the newest version.
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
     libopencv-dev : Depends: libopencv-objdetect-dev (= 2.4.8+dfsg1-2ubuntu1) but it is not going to be installed
                     Depends: libopencv-highgui-dev (= 2.4.8+dfsg1-2ubuntu1) but it is not going to be installed
                     Depends: libopencv-legacy-dev (= 2.4.8+dfsg1-2ubuntu1) but it is not going to be installed
                     Depends: libopencv-contrib-dev (= 2.4.8+dfsg1-2ubuntu1) but it is not going to be installed
                     Depends: libopencv-videostab-dev (= 2.4.8+dfsg1-2ubuntu1) but it is not going to be installed
                     Depends: libopencv-superres-dev (= 2.4.8+dfsg1-2ubuntu1) but it is not going to be installed
                     Depends: libopencv-ocl-dev (= 2.4.8+dfsg1-2ubuntu1) but it is not going to be installed
                     Depends: libcv-dev (= 2.4.8+dfsg1-2ubuntu1) but it is not going to be installed
                     Depends: libhighgui-dev (= 2.4.8+dfsg1-2ubuntu1) but it is not going to be installed
                     Depends: libcvaux-dev (= 2.4.8+dfsg1-2ubuntu1) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    linaro@linaro-nano:~$ sudo apt-get install libopencv-objdetect-dev libopencv-highgui-dev libopencv-legacy-dev libopencv-contrib-dev libopencv-videostab-dev libopencv-superres-dev libcvaux-dev libhighgui-dev libcv-dev libopencv-ocl-dev pkg-config build-essential libopencv-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    build-essential is already the newest version.
    pkg-config is already the newest version.
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
     libopencv-highgui-dev : Depends: libgtk2.0-dev but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    linaro@linaro-nano:~$ sudo apt-get install libgtk2.0-dev libopencv-objdetect-dev libopencv-highgui-dev libopencv-legacy-dev libopencv-contrib-dev libopencv-videostab-dev libopencv-superres-dev libcvaux-dev libhighgui-dev libcv-dev libopencv-ocl-dev pkg-config build-essential libopencv-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    build-essential is already the newest version.
    pkg-config is already the newest version.
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
     libgtk2.0-dev : Depends: libpango1.0-dev (>= 1.20) but it is not going to be installed
                     Depends: libcairo2-dev (>= 1.6.4-6.1) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    linaro@linaro-nano:~$ sudo apt-get install  libcairo2-dev libpango1.0-dev libgtk2.0-dev libopencv-objdetect-dev libopencv-highgui-dev libopencv-legacy-dev libopencv-contrib-dev libopencv-videostab-dev libopencv-superres-dev libcvaux-dev libhighgui-dev libcv-dev libopencv-ocl-dev pkg-config build-essential libopencv-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    build-essential is already the newest version.
    pkg-config is already the newest version.
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
     libcairo2-dev : Depends: libfontconfig1-dev (>= 2.2.95) but it is not going to be installed
                     Depends: libfreetype6-dev (>= 2.1.10) but it is not going to be installed
     libpango1.0-dev : Depends: libfreetype6-dev but it is not going to be installed
                       Depends: libxft-dev but it is not going to be installed
                       Depends: libfontconfig1-dev (>= 2.10.91) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    linaro@linaro-nano:~$ sudo apt-get install libfontconfig1-dev libxft-dev libfreetype6-dev libfontconfig1-dev libcairo2-dev libpango1.0-dev libgtk2.0-dev libopencv-objdetect-dev libopencv-highgui-dev libopencv-legacy-dev libopencv-contrib-dev libopencv-videostab-dev libopencv-superres-dev libcvaux-dev libhighgui-dev libcv-dev libopencv-ocl-dev pkg-config build-essential libopencv-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    build-essential is already the newest version.
    pkg-config is already the newest version.
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
     libfreetype6-dev : Depends: libfreetype6 (= 2.5.2-1ubuntu2) but 2.5.2-1ubuntu2.2 is to be installed
    E: Unable to correct problems, you have held broken packages.
Riwa Ml
  • 63
  • You can downgrade to the specific version of libfreetype6 by forcing apt-get to install the requested version: sudo apt-get install libfreetype6=2.5.2-1ubuntu2. Leave me a comment whether this helped and I might convert it to an answer you can accept. – Byte Commander Aug 20 '15 at 14:22

1 Answers1

2

The package libfreetype6-dev that you want to install requires the package libfreetype6 in the specific version 2.5.2-1ubuntu2, but you seem to have a slightly newer one installed. Unfortunately the libfreetype6-dev you want to install is configured to only accept one specific version of libfreetype6 instead of that one and newer versions (for a reason or not? I don't know).

To resolve the dependency, you can downgrade libfreetype6 by forcing apt-get to install the requested version:

sudo apt-get install libfreetype6=2.5.2-1ubuntu2
Byte Commander
  • 107,489