Error installing libjasper-dev and libpng12 package in ubuntu 19.04

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?

1

3 Answers

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

To install libjasper-dev using below:

Add the following line to /etc/apt/sources.list:
deb 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

To install libpng12 refer below link

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

2

You can install it:

apt-get install libpng-dev

You can download the source code from here and build:

$ wget
$ wget 

And export the library path as follow:

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like