安装 Clang++ 时未满足的依赖项

Svp*_*Svp 5 dependencies clang software-installation 16.04

尝试sudo apt-get installClang++时出现以下错误:

Note, selecting 'clang-tidy-4.0' for regex 'Clang+'
Note, selecting 'python-clang-5.0' instead of 'python-clang-x.y'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
Run Code Online (Sandbox Code Playgroud)
The following packages have unmet dependencies:
python-clang-3.5 : Breaks: python-clang-3.6 but 1:3.6.2-3ubuntu2 is to be installed
                Breaks: python-clang-3.7 but 1:3.7.1-2ubuntu2 is to be installed
                Breaks: python-clang-3.8 but 1:3.8-2ubuntu4 is to be installed
python-clang-3.6 : Breaks: python-clang-3.5 but 1:3.5.2-3ubuntu1 is to be installed
                Breaks: python-clang-3.7 but 1:3.7.1-2ubuntu2 is to be installed
                Breaks: python-clang-3.8 but 1:3.8-2ubuntu4 is to be installed
python-clang-3.7 : Breaks: python-clang-3.5 but 1:3.5.2-3ubuntu1 is to be installed
                Breaks: python-clang-3.6 but 1:3.6.2-3ubuntu2 is to be installed
                Breaks: python-clang-3.8 but 1:3.8-2ubuntu4 is to be installed
python-clang-3.8 : Breaks: python-clang-3.5 but 1:3.5.2-3ubuntu1 is to be installed
                Breaks: python-clang-3.6 but 1:3.6.2-3ubuntu2 is to be installed
                Breaks: python-clang-3.7 but 1:3.7.1-2ubuntu2 is to be installed
python-clang-3.9 : Breaks: python-clang-3.5 but 1:3.5.2-3ubuntu1 is to be installed
                Breaks: python-clang-3.6 but 1:3.6.2-3ubuntu2 is to be installed
                Breaks: python-clang-3.7 but 1:3.7.1-2ubuntu2 is to be installed
                Breaks: python-clang-3.8 but 1:3.8-2ubuntu4 is to be installed
python-clang-4.0 : Breaks: python-clang-3.5 but 1:3.5.2-3ubuntu1 is to be installed
                Breaks: python-clang-3.6 but 1:3.6.2-3ubuntu2 is to be installed
                Breaks: python-clang-3.7 but 1:3.7.1-2ubuntu2 is to be installed
                Breaks: python-clang-3.8 but 1:3.8-2ubuntu4 is to be installed
                Breaks: python-clang-3.9 but 1:3.9.1-4ubuntu3~16.04.2 is to be installed
python-clang-5.0 : Breaks: python-clang-3.5 but 1:3.5.2-3ubuntu1 is to be installed
                Breaks: python-clang-3.6 but 1:3.6.2-3ubuntu2 is to be installed
                Breaks: python-clang-3.7 but 1:3.7.1-2ubuntu2 is to be installed
                Breaks: python-clang-3.8 but 1:3.8-2ubuntu4 is to be installed
                Breaks: python-clang-3.9 but 1:3.9.1-4ubuntu3~16.04.2 is to be installed
Run Code Online (Sandbox Code Playgroud)

我不确定如何解决这些依赖关系,也不知道一个好的解决方法。我对 Linux 比较陌生。

我正在使用 Ubuntu 16.04 LTS

任何信息,将不胜感激。就我在论坛上阅读到的内容而言,我应该删除罪魁祸首程序或将其升级到所需的版本。但是从错误消息中,我无​​法真正找出这种情况下的罪魁祸首。

ste*_*ver 10

问题是没有包Clang++甚至没有clang++,因此apt将给定的名称视为正则表达式并尝试安装每个匹配的包 - 其中许多相互冲突:

$ sudo apt-get install --dry-run Clang++
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'clang-modernize-5.0' for regex 'Clang+'
Note, selecting 'libclang-3.6-dev' for regex 'Clang+'
.
.
.
Note, selecting 'python-clang-3.3' for regex 'clang+'
Note, selecting 'python-clang-3.4' for regex 'clang+'
Note, selecting 'python-clang-3.5' for regex 'clang+'
Note, selecting 'python-clang-3.6' for regex 'clang+'
Note, selecting 'python-clang-3.7' for regex 'clang+'
Note, selecting 'python-clang-3.8' for regex 'clang+'
Note, selecting 'python-clang-3.9' for regex 'clang+'
.
.
.
Run Code Online (Sandbox Code Playgroud)

事实上,与 不同gcc/g++clang将 C 和 C++ 编译器作为单个包提供 - 您可以安装特定版本,例如clang-3.5或简单地通过clang依赖包为您的系统安装最高优先级版本:

sudo apt install clang
Run Code Online (Sandbox Code Playgroud)

参见示例如何安装 clang++?