You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

树莓派4安装OpenCV时libhdf5-103无法安装的问题求助

问题场景
  • 设备:树莓派4
  • 系统:Raspbian(buster版本)
  • /etc/apt/source.list.d/raspi.list 文件内容:
deb http://archive.raspberrypi.org/debian/ buster main

执行搜索命令:

pi@raspberrypi:~ $ sudo apt-cache search libhdf5-103

返回结果:

libhdf5-103 - Hierarchical Data Format 5 (HDF5) - runtime files - serial version

但执行安装命令时出现404错误:

sudo apt-get install libhdf5-103

错误信息:

Err :1 http://raspbian.raspberrypi.org/raspbian buster/main armhf libhdf5-103 armhf 1.10.4+repack-10 404  Not Found
解决思路

1. 更新本地软件包缓存

apt-cache的搜索结果基于本地缓存,缓存过期会导致本地记录的包版本与远端仓库不一致。执行以下命令清理并强制更新缓存:

sudo apt-get clean
sudo apt-get update --fix-missing

2. 查找仓库中可用的libhdf5版本

buster版本的Raspbian仓库中,libhdf5-103可能已被移除或替换为其他版本,搜索所有相关包确认当前可用版本:

sudo apt-cache search libhdf5

找到存在的对应版本(比如libhdf5-100等),直接安装该版本即可。

3. 检查主软件源配置

确认/etc/apt/sources.list包含完整的buster官方源,避免源缺失导致包无法下载:

cat /etc/apt/sources.list

正常的buster源配置应类似:

deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

若缺失则补充配置,再执行sudo apt-get update。

4. 直接安装OpenCV预编译包(替代方案)

如果单独处理依赖遇到阻碍,可直接安装仓库中的OpenCV预编译包,它会自动处理所有依赖项:

sudo apt-get install python3-opencv

内容的提问来源于stack exchange,提问作者anraT

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 14:17:38