PCL入门(一):ubuntu20使用apt安装pcl

0. 背景

使用源码安装pcl较为麻烦,因为存在依赖库vtk,flann,boost,eigen等,都不太好安装,因此采用apt方式安装。

下面内容主要参考博客《【Ubuntu】Ubuntu安装PCL(安装PCL/卸载PCL/查看PCL版本/PCL报错处理相关操作)(史上最详细)》

1. apt安装的版本

使用如下命令查看当前ubuntu版本使用apt安装的最高pcl版本,ubuntu 20最高只能安装pcl 1.10版本

sudo apt-get install libpcl-dev

结果如下
在这里插入图片描述

2. 更新apt源

一般可以忽略这一步,但是如果你发现没法apt install pcl,那么考虑源的问题,我的源(注意,我是ubuntu 20,其他版本的ubuntu请自行寻找对应的源,很简单的)如下

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vim /etc/apt/sources.list

将下面的源保存

deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

更新操作如下

sudo apt-get update

3. apt安装命令

sudo apt-get install build-essential
sudo apt-get install libpcl-dev

4. 测试

apt-cache show libpcl-dev

如果是没有问题的话,如下是1.10版本
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_30841655/article/details/132671028
今日推荐