OpenCV安装libjasper-dev依赖包错误:E: Unable to locate package libjasper-dev

OpenCV安装libjasper-dev依赖包出现如下错误:

XXX@XXX:~/Files/opencv-3.1.0$ sudo apt-get install libjasper-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libjasper-dev

解决方法:

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

再次运行:

sudo apt install libjasper1 libjasper-dev

出现以下界面,即解决:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  libjasper-runtime
The following NEW packages will be installed:
  libjasper-dev libjasper1
0 upgraded, 2 newly installed, 0 to remove and 6 not upgraded.
Need to get 651 kB of archives.
After this operation, 1,406 kB of additional disk space will be used.
Get:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 libjasper1 amd64 1.900.1-debian1-2.4ubuntu1.2 [131 kB]
Get:2 http://security.ubuntu.com/ubuntu xenial-security/main amd64 libjasper-dev amd64 1.900.1-debian1-2.4ubuntu1.2 [520 kB]
Fetched 651 kB in 5s (131 kB/s)        
Selecting previously unselected package libjasper1:amd64.
(Reading database ... 199204 files and directories currently installed.)
Preparing to unpack .../libjasper1_1.900.1-debian1-2.4ubuntu1.2_amd64.deb ...
Unpacking libjasper1:amd64 (1.900.1-debian1-2.4ubuntu1.2) ...
Selecting previously unselected package libjasper-dev.
Preparing to unpack .../libjasper-dev_1.900.1-debian1-2.4ubuntu1.2_amd64.deb ...
Unpacking libjasper-dev (1.900.1-debian1-2.4ubuntu1.2) ...
Setting up libjasper1:amd64 (1.900.1-debian1-2.4ubuntu1.2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libjasper-dev (1.900.1-debian1-2.4ubuntu1.2) ...

你可能感兴趣的:(Linux)