参考:(未实践)
https://www.bilibili.com/video/BV11k4y1k7Li?t=732
https://waltpeter.github.io/open-cv-basic/install-opencv-ubuntu-cpp/index.html
实际安装使用薛大佬推荐方式

CLion环境配置 + C++配置(未测试此方法)
https://blog.csdn.net/qq_18649781/article/details/85927212#commentBox
CSDN-Ubuntu安装OpenCV(未测试)(高赞)

遇到的问题

Error: CMake executable is incorrect

解决方案:
(1)如果没有cmake,去下载cmake,下载方式自行百度。
检查是否有下载cmake,命令行输入
whereis cmake
结果可能包含路径 /usr/bin/cmake
(2)打开CLion
File->Settings(不是default settings)->Build,Execution,Deployment->Toolchains->CMake executable
选择custom,并填入路径 /usr/bin/cmake
保存后就解决了。
gdb executable is incorrect 解决方法同上。
source.

Ubuntu18.04下安装OpenCv依赖包libjasper-dev无法安装的问题

提示:errorE: unable to locate libjasper-dev
后来google到解决办法,复制到这里
sudo add-apt-repository "deb [http://security.ubuntu.com/ubuntu](http://security.ubuntu.com/ubuntu) xenial-security main"<br />``sudo apt update<br />``sudo apt install libjasper1 libjasper-dev
成功的解决了问题,其中libjasper1是libjasper-dev的依赖包
sourse:https://blog.csdn.net/weixin_41053564/article/details/81254410