8

After trying to install libclang-dev with sudo apt-get install -y libclang-dev i receive this error:

The following packages have unmet dependencies:
 libclang-dev : Depends: libclang-10-dev (>= 10~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

When I try the solution:

 $ wget https://apt.llvm.org/llvm.sh
 $ chmod +x llvm.sh
 $ sudo ./llvm.sh 12

Thiss occurs:

The following packages have unmet dependencies:
 clang-12 : Depends: libclang-common-12-dev (= 1:12.0.1~++20210511012537+24535af52ae1-1~exp1~20210510233243.87) but it is not going to be installed
 clangd-12 : Depends: libclang-common-12-dev (= 1:12.0.1~++20210511012537+24535af52ae1-1~exp1~20210510233243.87) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

The output of sudo apt-cache policy libc6

libc6:
  Installed: 2.31-0ubuntu9.2
  Candidate: 2.31-0ubuntu9.2
  Version table:
 *** 2.31-0ubuntu9.2 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.31-0ubuntu9 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

5 Answers5

11

You have to revert libc6 library to the normal version using command below:

sudo apt-get install libc6=2.31-0ubuntu9.2 libc6:i386=2.31-0ubuntu9.2
N0rbert
  • 103,263
3

For me it solved

sudo apt --fix-broken install
sudo apt-get update

And then installing with

sudo dpkg -i rstudio-specific-version.deb
2

I got same problem. I have run this steps (no idea what they did - I'm new on this, but works for me)

sudo apt-get autoremove

sudo apt-get autoclean

sudo apt-get update

sudo apt-get -f install

Willy
  • 21
0

On Ubuntu 24.04, make sure to install R first then proceed to installing RStudio with the following snap command:

sudo snap install rstudio --classic
-1

I was getting this message:

The following packages have unmet dependencies:
  clang : Depends: clang-10 (>= 10~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I solved my issue with this solution (formatting my own):

When I did sudo aptitude install clang, I got the same message as shown, but then typed n. aptitude then offers another solution, which is to offer to downgrade to gcc 9. Allow it to do that, and let it return to the command prompt. Then then do sudo apt install clang and you'll get clang-10.