ubuntu gengxin cmake
时间: 2023-08-08 17:11:32 浏览: 67
要在Ubuntu系统中更新cmake,你可以按照以下步骤进行操作:
1. 首先,确保你已经安装了wget工具。如果没有安装,可以使用以下命令进行安装:
```
sudo apt-get install wget
```
2. 进入到你想要下载cmake的目录,比如Downloads目录:
```
cd ~/Downloads
```
3. 下载cmake的源码包。你可以使用wget命令来下载指定版本的cmake,比如3.21.4版本:
```
wget https://github.com/Kitware/CMake/releases/download/v3.21.4/cmake-3.21.4-linux-x86_64.tar.gz
```
4. 解压下载的包:
```
tar -xzvf cmake-3.21.4-Linux-x86_64.tar.gz
```
5. 将解压出来的cmake文件夹移动到/opt目录下:
```
sudo mv cmake-3.21.4-Linux-x86_64 /opt/cmake-3.21.4
```
6. 建立软链接,将cmake可执行文件添加到系统的/usr/bin目录下:
```
sudo ln -sf /opt/cmake-3.21.4/bin/* /usr/bin/
```
7. 最后,验证cmake是否成功更新。运行以下命令检查cmake的版本:
```
cmake --version
```
这样,你就成功更新了cmake版本。请注意,千万不要使用`sudo apt-get autoremove cmake`命令来删除原有的cmake,否则会导致之前经过cmake编译的文件也被删除。\[1\]如果你遇到了OpenCV安装时cmake版本不符合要求的问题,可以按照上述步骤更新cmake版本。\[2\]\[3\]
#### 引用[.reference_title]
- *1* *3* [cmake升级、更新(ubuntu18.04)](https://blog.csdn.net/Boys_Wu/article/details/104940575)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Ubuntu16.04 安装/更新/升级cmake到 cmake3.9.1的具体安装过程](https://blog.csdn.net/qq_18649781/article/details/85634755)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)