6

I get the following error when trying to sudo apt-get install Clang++:

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:

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

I am unsure how to resolve these dependencies and don't know a good workaround for it. I am relatively new to Linux.

I am using Ubuntu 16.04 LTS

Any information would be appreciated. As far as I have been able to read here on the forums I should either remove the culprit program or upgrade it to the version that is needed. But from the error message I am unable to really gather what the culprit is in this case.

2

1 Answer 1

11

The problem is that there is no package Clang++ or even clang++, so apt is treating the given name as a regular expression and trying to install every matching package - many of which conflict with each other:

$ 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+'
.
.
.

In fact, unlike gcc/g++, clang provides both C and C++ compilers as a single package - you can install a specific version such as clang-3.5 or simply install the highest-priority version for your system via the clang dependency package:

sudo apt install clang

See for example How to install clang++?

0

Not the answer you're looking for? Browse other questions tagged .