【Linux】opencv在arm64上提示找不到libjasper-dev

news/2025/2/2 20:43:51 标签: linux, opencv, 运维

解决opencv在arm64上提示找不到libjasper-dev的问题。

本文首发于❄慕雪的寒舍

问题说明

最近我在尝试编译opencv,安装依赖项libjasper1libjasper-dev的时候就遇到了这个问题。在amd64平台上,我们可以通过下面的命令安装(ubuntu18.04)

apt-get install -y software-properties-common 
add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
apt-get -y update 
apt-get install -y libjasper1 libjasper-dev

但是在arm64的机器上,这个新添加的源会提示404。注意404不是网络问题,而是指定的文件不存在。根据这里显示的url,其实就是因为binary-arm64这个路径不存在。

Err:6 http://security.ubuntu.com/ubuntu xenial-security/main arm64 Packages
  404  Not Found [IP: 185.125.190.83 80]
Fetched 106 kB in 2s (44.6 kB/s)
Reading package lists... Done
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-arm64/Packages  404  Not Found [IP: 185.125.190.83 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

解决方案

根据这篇博客,arm架构的ubuntu18.04需要使用下面的方式安装这两个库。

将下面的清华源写入/etc/apt/sources.list文件的末尾(注意,如果你执行过上文的命令错误添加了会404的源,需要将那个源注释掉)

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe

image.png

修改文件之后,执行如下命令就可以安装了。

apt-get -y update 
apt-get install -y libjasper1 libjasper-dev

安装成功的输出如下

root@ubuntu-linux-22-04-02-desktop:/# apt-get install -y 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 0 not upgraded.
Need to get 613 kB of archives.
After this operation, 1327 kB of additional disk space will be used.
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-security/main arm64 libjasper1 arm64 1.900.1-debian1-2.4ubuntu1.3 [111 kB]
Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-security/main arm64 libjasper-dev arm64 1.900.1-debian1-2.4ubuntu1.3 [502 kB]
Fetched 613 kB in 1s (758 kB/s)    
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 2.)
debconf: falling back to frontend: Readline
Selecting previously unselected package libjasper1:arm64.
(Reading database ... 67223 files and directories currently installed.)
Preparing to unpack .../libjasper1_1.900.1-debian1-2.4ubuntu1.3_arm64.deb ...

搞定!


http://www.niftyadmin.cn/n/5840286.html

相关文章

FreeRTOS学习笔记2:FreeRTOS的基础知识

1.FreeRTOS介绍 FreeRTOS是一个免费的嵌入式实时操作系统&#xff0c;同时它在市面上也是一款主流的操作系统&#xff0c;是工作上必不可少的技能。它具有以下六种特点&#xff1a; 1.免费开源&#xff1a;在商业产品中使用&#xff0c;无潜在商业风险&#xff0c;无需担心。 2…

NIST的 临床质量指标的简介

啥是NIST&#xff1f; 美国国家标准与技术研究院&#xff08;National Institute of Standards and Technology&#xff0c;NIST&#xff09;直属美国商务部&#xff0c;从事物理、生物和工程方面的基础和应用研究&#xff0c;以及测量技术和测试方法方面的研究&#xff0c;提…

leetcode 2563. 统计公平数对的数目

题目如下 数据范围 显然数组长度最大可以到10的5次方n方的复杂度必然超时&#xff0c;阅读题目实际上就是寻找两个位置不同的数满足不等式即可(实际上i j无所谓是哪个 我们只要把位置小的想成i就行)。 按照上面的思路我们只需要排序数组然后从前往后遍历数组然后利用二分查找…

操作系统知识速记:死锁

操作系统知识速记&#xff1a;死锁 什么是死锁&#xff1f; 死锁是指两个或多个进程因争夺资源而造成的一种相互等待的状态&#xff0c;进程间形成循环等待&#xff0c;导致所有进程均无法继续执行。通常情况下&#xff0c;死锁的发生有以下四个必要条件&#xff1a; 互斥条…

Java小白入门教程:封装、继承、多态、重载、重写、抽象、接口

目录 一、封装&#xff08;Encapsulation&#xff09; 基本语法举例 真实实例 二、继承&#xff08;Inheritance&#xff09; 基本语法举例 真实实例 三、多态&#xff08;Polymorphism&#xff09; 基本语法举例 真实实例 四、重载&#xff08;Overloading&#xff0…

蓝桥杯算法笔记|差分学习

&#xff01;前情回顾 前缀和18437蓝桥账户中心 练习代码&#xff1a; #include <iostream> using namespace std; int main() {// 请在此输入您的代码int n,q;cin>>n>>q;int a[n];for(int i0;i<n;i){cin>>a[i];}int sum[n];sum[0]a[0];for(int …

SQL进阶实战技巧:如何构建用户行为转移概率矩阵,深入洞察会话内活动流转?

目录 1 场景描述 1.1 用户行为转移概率矩阵概念 1.2 用户行为转移概率矩阵构建方法 (1) 数据收集

C语言怯魅——指针和数组

C语言怯魅——指针和数组 指针—— C的精华&#xff0c;也是重难点&#xff0c;很多人将C作为入门语言&#xff0c;指针往往成了新手入门编程的拦路虎。 其本质很简单&#xff0c;但由于衍生出来的用法多样&#xff0c;知晓如何以及何时使用指针并不简单。 以下是我个人的一些经…