Ubuntu安装gcc的命令
时间: 2023-10-23 11:11:59 浏览: 125
Ubuntu 15.10 GCC-4.3离线安装附件
要在Ubuntu上安装gcc,可以使用以下命令之一:
1. 使用命令sudo apt install build-essential,该命令将安装一堆新包,包括gcc,g ++和make。要验证GCC编译器是否已成功安装,可以使用gcc -v命令打印GCC版本。\[1\]
2. 另一种方法是使用以下命令安装特定版本的gcc:
- sudo apt install gcc-7 g++-7:安装GCC 7
- sudo apt install gcc-8 g++-8:安装GCC 8
- sudo apt install gcc-9 g++-9:安装GCC 9
- sudo apt install gcc-10 g++-10:安装GCC 10。\[2\]
总结起来,要在Ubuntu上安装gcc,可以使用sudo apt install build-essential命令安装基本的gcc编译器,或者使用特定版本的gcc进行安装。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* [gcc在Ubuntu上安装和使用](https://blog.csdn.net/qlexcel/article/details/120649645)[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_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Ubuntu上安装gcc](https://blog.csdn.net/MashiMaroJ/article/details/126214729)[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_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [如何在ubuntu上安装gcc](https://blog.csdn.net/qq_52686989/article/details/129759211)[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_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文