如何通过apt安装最新的clang 3.8


8

在这里,我找到了如何安装clang3.8的说明:http ://llvm.org/apt/

所以我执行了:

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

结果:

    --2015-09-19 12:53:09--  http://llvm.org/apt/llvm-snapshot.gpg.key
    Resolving llvm.org (llvm.org)... [sudo] password for user: 192.17.58.186
    Connecting to llvm.org (llvm.org)|192.17.58.186|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 3145 (3,1K) [application/pgp-keys]
    Saving to: ‘STDOUT’

    100%[======================================>] 3.145       --.-K/s   in 0,002s  

    2015-09-19 12:53:10 (1,87 MB/s) - written to stdout [3145/3145]
OK

然后:

sudo apt-get install clang-3.8 clang-3.8-doc libclang-common-3.8-dev libclang-3.8-dev libclang1-3.8 libclang1-3.8-dbg libllvm-3.8-ocaml-dev libllvm3.8 libllvm3.8-dbg lldb-3.8 llvm-3.8 llvm-3.8-dev llvm-3.8-doc llvm-3.8-examples llvm-3.8-runtime clang-modernize-3.8 clang-format-3.8 python-clang-3.8 lldb-3.8-dev liblldb-3.8-dbg

但我得到:

E: Unable to locate package clang-3.8
E: Couldn't find any package by regex 'clang-3.8'
E: Unable to locate package clang-3.8-doc
E: Couldn't find any package by regex 'clang-3.8-doc'
E: Unable to locate package libclang-common-3.8-dev
E: Couldn't find any package by regex 'libclang-common-3.8-dev'
E: Unable to locate package libclang-3.8-dev
E: Couldn't find any package by regex 'libclang-3.8-dev'
E: Unable to locate package libclang1-3.8
E: Couldn't find any package by regex 'libclang1-3.8'
E: Unable to locate package libclang1-3.8-dbg
E: Couldn't find any package by regex 'libclang1-3.8-dbg'
...........................

我的操作系统是Linux Mint 17 3.13.0-24-generic#47-Ubuntu SMP x86_64 x86_64 x86_64 GNU / Linux

为什么apt-get找不到那些软件包?


3
您是否将LLVM的存储库定义行添加到/etc/apt/sources.list文件中或作为文件添加到其中/etc/apt/sources.list.d/$somefilename.list

您找到此问题的解决方案了吗?我现在正面临着完全相同的问题,我不知道下一步该怎么做。
jcxz

首先,您应该添加正确的存储库。要在Ubuntu 14.04上安装clang 3.7,您需要从列表中运行命令。我找不到clang 3.8存储库地址。apt-add-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main"
Tomilov Anatoliy

Answers:


6

正如Orient在评论中所说,您首先需要添加存储库。但是哪个存储库?答案被隐藏在您链接的页面上。由于3.8是当前版本,因此您需要添加没有版本号的存储库。我不知道您的Linux Mint版本会转换成什么发行版,但是要使Ubuntu 14.04与Orient的示例匹配,您可以使用:

sudo apt-add-repository "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

$ clang-3.8 -v
Ubuntu clang version 3.8.0-svn262614-1~exp1 (trunk) (based on LLVM 3.8.0)
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.