在Ubuntu 14.04.3上安装clang 3.8


15

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

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.

希望使用的clang版本高于3.5。有什么建议么?


您能否编辑您的问题并包括apt-cache search clang
Wayne_Yux

Answers:


24

看起来14.04.3的最新版本是Trusty Updates中的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:~$ 

希望这会帮助您...


如您在llvm.org/apt/trusty/dists上看到的那样,只有这种版本才可以使用3.7版
Kyle McCormick

确实,将其留给我,我将与页面所有者联系。讨厌给别人不好的建议,所以我绝对会追逐这件事……
andrew.46 2016年

1
好的,我已经给Sylvestre发了电子邮件,希望这个问题可以解决。
andrew.46 2016年

尚无答案:(
andrew.46 2016年

6
哇,这是问答环节中的新范式,您首先给出一个答案,然后使这个答案成真:)
enobayram
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.