换镜像源
因为工作需要,我想把之前Jetson Orin Nano上OpenCV4.5.4 升级到OpenCV4.8。先到这里下载脚本
wget https://github.com/Qengineering/Install-OpenCV-Jetson-Nano/raw/main/OpenCV-4-8-0.sh
然后我尝试运行这个脚本
./OpenCV-4-8-0.sh
结果告诉无法访问官方的ubuntu.port的网站,我晕倒!
然后我听说可以换镜像源,先找到etc/apt/source.list这个文件所在的文件夹,然后先执行:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
再执行:
sudo gedit /etc/apt/sources.list
然后找到对应的源文件,推荐用这里的
https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/
打开上面的链接,然后选择如下:
然后copy上面代码部分的内容直接替换:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse # deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse # 预发布软件源,不建议启用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
替换完成以后,保存以后一定要运行下面两句话:
sudo apt update sudo apt upgrade -y
编译OpenCV4.8
先授权可执行
sudo chmod 755 ./OpenCV-4-8-0.sh
然后再次运行下面这个脚本:
./OpenCV-4-8-0.sh
真的可以编译了,然后测试一下,真的是OpenCV4.8了
OpenCV4.8升级Get,从此我又相信Jetson Nano 可以跟OpenCV在一起了!请期待后续更新~~~~~