由于linux上cmake版本较低需要更新,参考了https://blog.csdn.net/ykwjt/article/details/88353622
,使用了坑爹的apt-get autoremove命令卸载老版本cmake(如下命令)
sudo apt-get autoremove cmake
导致cmake的一堆依赖都被卸载,再重新按照该博文安装cmake出现大量报错。其实没必要执行这一步,按照博文的其他步骤直接安装新版本即可
补救方法:
https://zhuanlan.zhihu.com/p/160926980
sudo vim /var/log/apt/history.log
执行上述命令找到如下内容可以看到卸载cmake时同时卸载的包,重新一个一个的sudo apt-get install
Start-Date: 2021-05-11 10:18:22
Commandline: apt-get autoremove cmake
Requested-By: shaorenjie (995)
Remove: linux-modules-extra-4.15.0-140-generic:amd64 (4.15.0-140.144~16.04.1), cmake-data:amd64 (3.5.1-1ubuntu3), linux-headers-4.15.0-45:amd64 (4.15.0-45.48~16.04.1), linux-modules-extra-4.15.0-45-generic:amd64 (4.15.0-45.48~16.04.1), linux-headers-4.15.0-137-generic:amd64 (4.15.0-137.141~16.04.1), linux-headers-4.15.0-136-generic:amd64 (4.15.0-136.140~16.04.1), linux-modules-4.15.0-45-generic:amd64 (4.15.0-45.48~16.04.1), linux-modules-4.15.0-136-generic:amd64 (4.15.0-136.140~16.04.1), linux-headers-4.15.0-45-generic:amd64 (4.15.0-45.48~16.04.1), linux-image-4.15.0-137-generic:amd64 (4.15.0-137.141~16.04.1), linux-headers-4.15.0-139-generic:amd64 (4.15.0-139.143~16.04.1), linux-image-4.15.0-136-generic:amd64 (4.15.0-136.140~16.04.1), linux-image-4.15.0-139-generic:amd64 (4.15.0-139.143~16.04.1), linux-headers-4.15.0-140-generic:amd64 (4.15.0-140.144~16.04.1), linux-modules-4.15.0-137-generic:amd64 (4.15.0-137.141~16.04.1), cmake:amd64 (3.5.1-1ubuntu3), linux-modules-4.15.0-140-generic:amd64 (4.15.0-140.144~16.04.1), linux-headers-4.15.0-136:amd64 (4.15.0-136.140~16.04.1), linux-headers-4.15.0-137:amd64 (4.15.0-137.141~16.04.1), linux-headers-4.15.0-139:amd64 (4.15.0-139.143~16.04.1), linux-headers-4.15.0-140:amd64 (4.15.0-140.144~16.04.1), linux-modules-extra-4.15.0-137-generic:amd64 (4.15.0-137.141~16.04.1), linux-image-4.15.0-140-generic:amd64 (4.15.0-140.144~16.04.1), libjsoncpp1:amd64 (1.7.2-1), linux-modules-4.15.0-139-generic:amd64 (4.15.0-139.143~16.04.1), linux-modules-extra-4.15.0-136-generic:amd64 (4.15.0-136.140~16.04.1), linux-modules-extra-4.15.0-139-generic:amd64 (4.15.0-139.143~16.04.1), linux-image-4.15.0-45-generic:amd64 (4.15.0-45.48~16.04.1)
End-Date: 2021-05-11 10:18:51
Start-Date: 2021-05-11 10:20:09
Commandline: apt-get install cmake
Requested-By: shaorenjie (995)
Install: cmake-data:amd64 (3.5.1-1ubuntu3, automatic), cmake:amd64 (3.5.1-1ubuntu3), libjsoncpp1:amd64 (1.7.2-1, automatic)
End-Date: 2021-05-11 10:20:11