Сломанные пакеты при попытке установить clang в Ubuntu 18.04

Я попытался установить clang в Ubuntu 18.04, но не смог его установить. Я попытался sudo apt install clang и получил следующие результаты:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
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:
 clang : Depends: clang-6.0 (>= 6.0~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Я прочитал некоторые ответы о удерживаемых пакетах и ​​попробовал sudo aptitude install clang, но это также не сработало.

Я получил следующие результаты:

The following NEW packages will be installed:
  clang-6.0 lib32gcc1{ab} lib32stdc++6{ab} libc6-i386{a} libclang-common-6.0-dev{a} libclang1-6.0{a} libffi-dev{a} libjsoncpp1{a} libobjc-7-dev{ab} libobjc4{ab} libpython-stdlib{a} libtinfo-dev{ab} 
  llvm-6.0{a} llvm-6.0-dev{a} llvm-6.0-runtime{a} python{a} python-minimal{a} python2.7{ab} python2.7-minimal{ab} 
0 packages upgraded, 19 newly installed, 0 to remove and 0 not upgraded.
Need to get 53.4 MB of archives. After unpacking 313 MB will be used.
The following packages have unmet dependencies:
 lib32stdc++6 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.3.0-6ubuntu1~18.04 is installed
 libobjc4 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.3.0-6ubuntu1~18.04 is installed
 python2.7-minimal : Depends: libpython2.7-minimal (= 2.7.15~rc1-1) but 2.7.15~rc1-1ubuntu0.1 is installed
 python2.7 : Depends: libpython2.7-stdlib (= 2.7.15~rc1-1) but 2.7.15~rc1-1ubuntu0.1 is installed
 lib32gcc1 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.3.0-6ubuntu1~18.04 is installed
 libobjc-7-dev : Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.4.0-1ubuntu1~18.04 is installed
                 Depends: libgcc-7-dev (= 7.3.0-16ubuntu3) but 7.4.0-1ubuntu1~18.04 is installed
 libtinfo-dev : Depends: libtinfo5 (= 6.1-1ubuntu1) but 6.1-1ubuntu1.18.04 is installed
The following actions will resolve these dependencies:

      Keep the following packages at their current version:
1)      clang-6.0 [Not Installed]                          
2)      lib32gcc1 [Not Installed]                          
3)      lib32stdc++6 [Not Installed]                       
4)      libclang-common-6.0-dev [Not Installed]            
5)      libobjc-7-dev [Not Installed]                      
6)      libobjc4 [Not Installed]                           
7)      libtinfo-dev [Not Installed]                       
8)      llvm-6.0-dev [Not Installed]                       
9)      python [Not Installed]                             
10)     python-minimal [Not Installed]                     
11)     python2.7 [Not Installed]                          
12)     python2.7-minimal [Not Installed]                  

      Leave the following dependencies unresolved:         
13)     python-minimal recommends python                   
14)     python2.7-minimal recommends python2.7             
15)     clang-6.0 recommends python                        
16)     llvm-6.0 recommends llvm-6.0-dev                   

Accept this solution? [Y/n/q/?] y
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.
2
задан 30 July 2019 в 09:40

2 ответа

Установите более позднюю версию лязга из репозиториев Ubuntu 18.04 по умолчанию, который не конфликтует ни с какими другими пакетами, которые уже установлены. Откройте терминал и тип:

sudo apt install python llvm-8-dev clang-8 clang-tools-8 libclang-common-8-dev libobjc-7-dev libobjc-8-dev 
1
ответ дан 2 December 2019 в 04:36

Как обозначено здесь необходимо включить комплект бионических обновлений в sources.list
предварительно ожидайте или добавьте следующий блок к своему/etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe

#deb-src http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe
#deb-src http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe
#deb-src http://archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe

не прокомментируйте deb-src строки, если Вы хотите исходный код от репозиториев при необходимости в этом.
затем просто выполненный sudo apt update; sudo apt install clang и Вы будете хороши.

0
ответ дан 2 December 2019 в 04:36

Другие вопросы по тегам:

Похожие вопросы: