最近在安装RealSense相机SDK时,遇到了一个小问题,特此分享解决方法。我参考了一篇教程(链接:https://blog.csdn.net/Time_Memory_cici/article/details/128640596),在执行./scripts/patch-realsense-ubuntu-lts.sh
这一步时,终端报错如下:
Package required libusb-1.0-0-dev: - found
Package required libssl-dev: - found
Create patches workspace in ubuntu-bionic-hwe-5.4 folder
Package required libelf-dev: - found
Package required elfutils: - found
Package required bison: - found
Package required flex: - found
fatal: repository 'https://kernel.ubuntu.com/ubuntu/ubuntu-bionic.git/' not found
Fetching Ubuntu LTS tag to the local kernel sources folder
fatal: 您需要指定一个标签名称。
主要问题出在"https://kernel.ubuntu.com/ubuntu/ubuntu-bionic.git/"似乎已经不再可用。通过查询,发现将网址修改为"https://kernel.ubuntu.com/git/ubuntu/ubuntu-bionic.git/"即可解决这个问题。具体操作如下:
-
使用文本编辑器(比如vim、gedit、vscode等)打开文件:
/librealsense/scripts/patch-realsense-ubuntu-lts.sh
。 -
找到第102行开始的代码块:
# Get the linux kernel and change into source tree
if [ ! -d ${kernel_name} ]; then
mkdir ${kernel_name}
cd ${kernel_name}
git init
git remote add origin https://kernel.ubuntu.com/ubuntu/ubuntu-${ubuntu_codename}.git
cd ..
fi
-
将上述代码块中的
https://kernel.ubuntu.com/ubuntu/ubuntu-${ubuntu_codename}.git
修改为https://kernel.ubuntu.com/git/ubuntu/ubuntu-${ubuntu_codename}.git
。 -
保存文件。
-
在重新运行"./scripts/patch-realsense-ubuntu-lts.sh"指令之前,删除librealsense下新建的"ubuntu-bionic-hwe-5.4"文件夹。这一步很重要,否则不会进入if语句。
通过以上步骤,应该能够成功修复这个问题并顺利完成RealSense相机SDK的安装。希望对你有帮助!