无法找到包libjasper-dev

时间:2017-06-09 23:49:21

标签: opencv image-processing

我想在ubuntu 17.04中安装opencv,我知道jasper库是从ubuntu 17.04中删除的

我该怎么做才能正确完成安装opencv ???

我尝试使用以下两个显示here的命令,但它不起作用

  

sudo apt-get install opencv-data

     

sudo apt-get install libopencv-dev

4 个答案:

答案 0 :(得分:15)

使用以下命令:

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev

答案 1 :(得分:2)

尝试this answer

您将能够从先前版本安装libjasper-dev

答案 2 :(得分:1)

要为 Ubuntu 构建最新版本的 libjasper,请执行以下操作:

从这里下载 Jasper 源代码:https://github.com/jasper-software/jasper/tree/version-2.0.25

运行以下脚本:

#!/bin/bash

VERSION=2.0.25

unzip jasper-version-$VERSION.zip
cd jasper-version-$VERSION
mkdir compile

SOURCE_DIR=`pwd`
BUILD_DIR=compile
INSTALL_DIR=/usr
OPTIONS=

cmake -G "Unix Makefiles" -H$SOURCE_DIR -B$BUILD_DIR -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR $OPTIONS

cd compile
make clean all

cat >description-pak <<EOF
JasPer Image Processing/Coding Tool Kit
EOF

fakeroot checkinstall --fstrans --install=no --pkgname=libjasper --pkgversion=$VERSION --pkgrelease 1 --pkglicense="JasPer 2.0" \
         bash -c "make install" </dev/null

mv libjasper_$VERSION-1_amd64.deb ../..
cd ../..
rm -rf jasper-version-$VERSION

结果是一个可以使用 dpkg 或 apt 安装的 Debian 软件包。

答案 3 :(得分:0)

在Ubuntu18.04下,如果直接script_path = os.path.abspath(__file__) project_path = os.path.dirname(script_path) pdfs_path = os.path.join(project_path, 'PDFS') 会遇到另一个GPG错误。

add-apt-repository

您必须更新密钥

$ sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures were invalid: ...EXPKEYSIGhttps://dl.yarnpkg.com/debian/dists/stable/InRelease  The following signatures were invalid: EXPKEYSIG ...

那么您现在可以安全地安装 sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com

libjasper-dev

Reference