在 Ubuntu 14.04.3 上安装 clang 3.8

在 Ubuntu 14.04.3 上安装 clang 3.8

我尝试过以下明显的命令:

sudo apt-get update
sudo apt-get install clang-3.8

但我收到了消息:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我已经尝试过了:

sudo apt-get update
sudo aptitude install clang-3.8

但收到消息:

Couldn't find package "clang-3.8".  However, the following
packages contain "clang-3.8" in their name:
  clang-3.8-doc 
Couldn't find package "clang-3.8".  However, the following
packages contain "clang-3.8" in their name:
  clang-3.8-doc 
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

希望有比 3.5 更新的 clang 版本。有什么建议吗?

答案1

看起来最新版本是 14.04.3Trusty 更新中的 clang 3.6。但开发人员维护了一个 PPA,它应该可以为您提供最新版本:

LLVM Debian/Ubuntu 夜间软件包

要安装 3.8,您首先需要添加密钥:

wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -

然后通过手动添加以下行/etc/apt/sources.list(或使用 gui“软件和更新”)添加 3.8 的存储库:

deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.8 main

此处的屏幕截图演示了该技术:

在此处输入图片描述

然后运行以下命令:

sudo apt-get update
sudo apt-get install clang-3.8 lldb-3.8

按如下方式测试安装:

andrew@corinth:~$ clang-3.8 --version
clang version 3.8.0-svn262614-1~exp1 (branches/release_38)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
andrew@corinth:~$ 

希望这能帮助你...

相关内容