19

I want to install opencv in ubuntu 17.04 and I know that the jasper library is removed from ubuntu 17.04

what should I do to complete install opencv correctly ???

I tried used this two below command that showed here but it does not work

sudo apt-get install opencv-data

sudo apt-get install libopencv-dev

Community
  • 1
  • 1
programmer
  • 577
  • 1
  • 9
  • 21

6 Answers6

35

Use these commands:

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

This worked on my Ubuntu 18.04 after I replaced the double-quotes with single quotes. With the double quotes I was getting this error:

Error: need a single repository as argument
DMin
  • 10,049
  • 10
  • 45
  • 65
Sirosh Bashir
  • 469
  • 4
  • 4
6

Try this answer

You will be able to install the libjasper-dev from a previous release

chittychitty
  • 419
  • 5
  • 12
  • 1
    https://stackoverflow.com/a/48326450/5326336 - This answer is more updated(in the same post) – DeSpeaker Aug 29 '19 at 10:32
  • Instead of linking to an answer in another more or less identical question, please flag the question as duplicate. This answer doesn’t add any information, it is just a sign post. Flagging as duplicate is the right way to set up a sign post. – Cris Luengo Jun 22 '23 at 00:48
3

Under Ubuntu18.04, if you directly add-apt-repository will encounter another GPG error.

$ 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 ...

You have to update the key

sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com

Then you are now safe to install libjasper-dev.

sudo apt-get install libjasper-dev

Reference

stackoverYC
  • 490
  • 2
  • 4
  • 13
2

To build the latest version of libjasper as package for Ubuntu do the following:

Download the Jasper source code from here: https://github.com/jasper-software/jasper/tree/version-2.0.25

Run the following script:

#!/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

Result is a Debian package that can be installed using dpkg or apt.

Meixner
  • 615
  • 5
  • 8
0

This Solution was tested on mendel(debian) with arm64 architecture. If this works for Ubuntu is not clear.

Open terminal and run the following commands:

cd /etc/apt/sources.list.d
sudo nano multistrap-main.list

Add there these two lines:

deb http://ports.ubuntu.com/ubuntu-ports xenial-security main
deb http://ports.ubuntu.com/ubuntu-ports impish main

save and exit. Then run:

sudo apt update

If there is a key missing use the following and run again update:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <key>

Then install jasper:

sudo apt-get install libjasper-dev

Finally remove or comment out the added repositories from multistrap-main.list.

w0rs3
  • 1
  • 3
0

Add the Repository to APT

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

Run an advanced key server command

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32

Update the package manager

$ sudo apt update

Install the libjasper-dev library

$ sudo apt install libjasper1 libjasper-dev