點選上方 藍字 關註我們
微信公眾號: OpenCV學堂
關註獲取更多電腦視覺與深度學習知識
Jetson換映像
源
因為工作需要,我想把之前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
替換完成以後,保存以後 一定要執行 下面兩句話:
sudoapt update
sudoapt 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在一起了!請期待後續更新~~~~~
學習 一書,獲取Jetson Nano上各種OpenCV開發技能。做真正的OpenCV開發者,從入門到入職,一步到位!
推薦閱讀