1

I tried to install libjasper-dev and libpng12 for opencv but I'm getting this error:

E: Unable to locate package libjasper-dev E: Unable to locate package libpng12

I also tried installing libpng16 but still I was getting the same error. How can I solve this problem?

  • A quick search shows https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=libjasper-dev fpr the first one (ie. it's available for 16.04 LTS), likewise for the second https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=libjasper I don't know enough about the packages to know more, but a quick look and it was last used in jessie (debian old-stable) upstream (outside a version in sid; https://packages.debian.org/search?keywords=libjasper-dev) – guiverc May 24 '19 at 05:35

3 Answers3

1

Alternative solution:

  1. Add the following to etc/apt/source.list - this is a document you can navigate to in file manager
### Preface with a comment is optional
### Helps to remember why something was added to the list later on

### Added for libjasper-dev
deb http://security.ubuntu.com/ubuntu xenial-security main 
  1. Update the package index
sudo apt-get update
  1. Install libjasper-dev
sudo apt-get install libjasper-dev

P.S. You may want to keep in mind that this library may be outdated or not intended for your version of Linux, so there's always a possibility that what you want it for will not work properly or stop working eventually.

Sabidos
  • 11
0

To install libjasper-dev using below:

Add the following line to /etc/apt/sources.list:

deb http://ftp.fau.de/trinity/trinity-builddeps-r14.0.0/ubuntu/ bionic main

Install GPG key of the repository:

# sudo apt-key adv --keyserver keyserver.quickbuild.io --recv-keys F5CFC95C

Update the package index:

# sudo apt-get update

Install libjasper-dev deb package:

# sudo apt-get install libjasper-dev

Reference https://ubuntu.pkgs.org/18.04/trinity-r14-builddeps-i386/libjasper-dev_1.900.1-debian1-2.5ubuntu18.04.0+5_i386.deb.html

To install libpng12 refer below link

E: Package 'libpng12-0' has no installation candidate [ubuntu 16.10 Gnome]

  • GPG error: http://ftp.fau.de/trinity/trinity-builddeps-r14.0.0/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C93AF1698685AD8B – gone Feb 27 '20 at 23:18
  • 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: EXPKEYSIG 23E7166788B63E1E Yarn Packaging yarn@dan.cx – stackoverYC May 07 '21 at 01:38
0

You can install it:

apt-get install libpng-dev

You can download the source code from here and build:

$ wget https://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/jasper-1.900.1.tar.gz

$ wget https://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/libpng-1.2.50.tar.gz

And export the library path as follow:

$ export JASPERLIB=/home/user/build/grib2/lib
$ export JASPERINC=/home/user/build/grib2/include