农妇山泉一亩田 发表于 2024-11-3 12:06:09

在ubuntu上安装最新版的clang

方法一:

执行如下的下令:
# 下载安装脚本

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
# 开始下载, 输入需要安装的版本号。
sudo ./llvm.sh <version number>

方法二

添加软件下载源。
请根据本身的Ubuntu系统版本添加,一次性全部都添加了。
Focal (20.04) LTS - Last update : Fri, 01 Nov 2024 20:11:24 UTC / Revision: 20241101053558+f04aaf948204
deb http://apt.llvm.org/focal/ llvm-toolchain-focal main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal main
# 18
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main
# 19
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-19 main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-19 main
Jammy (22.04) LTS - Last update : Fri, 01 Nov 2024 17:15:30 UTC / Revision: 20241101031257+b74e588e1f46
deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main
deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy main
# 18
deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
# 19
deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
Lunar (23.04) - Last update : Fri, 01 Nov 2024 19:58:02 UTC / Revision: 20241101045725+64314dedebfc
deb http://apt.llvm.org/lunar/ llvm-toolchain-lunar main
deb-src http://apt.llvm.org/lunar/ llvm-toolchain-lunar main
# 18
deb http://apt.llvm.org/lunar/ llvm-toolchain-lunar-18 main
deb-src http://apt.llvm.org/lunar/ llvm-toolchain-lunar-18 main
# 19
deb http://apt.llvm.org/lunar/ llvm-toolchain-lunar-19 main
deb-src http://apt.llvm.org/lunar/ llvm-toolchain-lunar-19 main
Mantic (23.10) - Last update : Fri, 01 Nov 2024 23:59:37 UTC / Revision: 20241101083758+57183b6fe11a
deb http://apt.llvm.org/mantic/ llvm-toolchain-mantic main
deb-src http://apt.llvm.org/mantic/ llvm-toolchain-mantic main
# 18
deb http://apt.llvm.org/mantic/ llvm-toolchain-mantic-18 main
deb-src http://apt.llvm.org/mantic/ llvm-toolchain-mantic-18 main
# 19
deb http://apt.llvm.org/mantic/ llvm-toolchain-mantic-19 main
deb-src http://apt.llvm.org/mantic/ llvm-toolchain-mantic-19 main
Noble (24.04) - Last update : Fri, 01 Nov 2024 23:20:06 UTC / Revision: 20241101081855+b24650e814e5
deb http://apt.llvm.org/noble/ llvm-toolchain-noble main
deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble main
# 18
deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main
deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main
# 19
deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main
deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main
Oracular (24.10) - Last update : Fri, 01 Nov 2024 23:38:13 UTC / Revision: 20241101083605+57183b6fe11a
deb http://apt.llvm.org/oracular/ llvm-toolchain-oracular main
deb-src http://apt.llvm.org/oracular/ llvm-toolchain-oracular main
# 18
deb http://apt.llvm.org/oracular/ llvm-toolchain-oracular-18 main
deb-src http://apt.llvm.org/oracular/ llvm-toolchain-oracular-18 main
# 19
deb http://apt.llvm.org/oracular/ llvm-toolchain-oracular-19 main
deb-src http://apt.llvm.org/oracular/ llvm-toolchain-oracular-19 main
然后执行安装指令:
apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python3-clang
refs: llvm官网的guide

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 在ubuntu上安装最新版的clang