9

I use ubuntu 20.04.2. I had some problems with rStudio so I unistalled completelly from my computer. I already have installed r, but now I want to install rStudio but when I try to I get that 'libclang-dev' is uninstallable.

$ sudo gdebi rstudio-1.4.1106-amd64.deb

Reading package lists... Done
Building dependency tree        
Reading state information... Done
Reading state information... Done
This package is uninstallable
Cannot install 'libclang-dev'

I have tried to install clang, but I get more errors:

$ 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-10 (>= 10~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Zoe
  • 27,060
  • 21
  • 118
  • 148
IgnacioNC
  • 311
  • 2
  • 7
  • Your question has nothing to do with R, unfortunately, even though it is impacting your ability to install the RStudio IDE. You need to venture outside of the [tag:r] and [tag:rstudio] tags and search instead for debian/ubuntu package installation problems, perhaps googling `held broken packages`. – r2evans May 04 '21 at 12:36
  • Because of that, this question might be better suited for askubuntu.com or superuser.com. – r2evans May 04 '21 at 12:36

2 Answers2

22

I manage to solve it. I run sudo aptitude install clang. First yo need to say no ("n") to the first proposal you get, and a new one will appear. If you accept ("y") this second one some packages are installed:

<pre>The following NEW packages will be installed:
  clang clang-10{a} lib32gcc-s1{a} lib32stdc++6{a} libc6-i386{ab} libclang-common-10-dev{a} libclang-cpp10{a} libclang1-10{a} libffi-dev{a} libllvm10{a} libncurses-dev{a} libobjc-9-dev{a} libobjc4{a} 
  libomp-10-dev{a} libomp5-10{a} libpfm4{a} libtinfo-dev{a} libz3-4{a} libz3-dev{a} llvm-10{a} llvm-10-dev{a} llvm-10-runtime{a} llvm-10-tools{a} 
0 packages upgraded, 23 newly installed, 0 to remove and 0 not upgraded.
Need to get 81,1 MB of archives. After unpacking 488 MB will be used.
The following packages have unmet dependencies:
 libc6-i386 : Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.3 is installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     clang [Not Installed]                              
2)     clang-10 [Not Installed]                           
3)     lib32gcc-s1 [Not Installed]                        
4)     lib32stdc++6 [Not Installed]                       
5)     libc6-i386 [Not Installed]                         
6)     libclang-common-10-dev [Not Installed]</pre>

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Downgrade the following packages:                                        
1)     libc-dev-bin [2.31-0ubuntu9.3 (now) -> 2.31-0ubuntu9.2 (focal-updates)]
2)     libc6 [2.31-0ubuntu9.3 (now) -> 2.31-0ubuntu9.2 (focal-updates)]       
3)     libc6-dbg [2.31-0ubuntu9.3 (now) -> 2.31-0ubuntu9.2 (focal-updates)]   
4)     libc6-dev [2.31-0ubuntu9.3 (now) -> 2.31-0ubuntu9.2 (focal-updates)]   



Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
  libc-dev-bin libc6 libc6-dbg libc6-dev 
The following NEW packages will be installed:
  clang clang-10{a} lib32gcc-s1{a} lib32stdc++6{a} libc6-i386{a} libclang-common-10-dev{a} libclang-cpp10{a} libclang1-10{a} libffi-dev{a} libllvm10{a} libncurses-dev{a} libobjc-9-dev{a} libobjc4{a} 
  libomp-10-dev{a} libomp5-10{a} libpfm4{a} libtinfo-dev{a} libz3-4{a} libz3-dev{a} llvm-10{a} llvm-10-dev{a} llvm-10-runtime{a} llvm-10-tools{a} 
0 packages upgraded, 23 newly installed, 4 downgraded, 0 to remove and 0 not upgraded.
Need to get 96,9 MB of archives. After unpacking 488 MB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://es.archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6-dev amd64 2.31-0ubuntu9.2 [2.520 kB]
Get: 2 http://es.archive.ubuntu.com/ubuntu focal-updates/main amd64 libc-dev-bin amd64 2.31-0ubuntu9.2 [71,8 kB]
Get: 3 http://es.archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6-dbg amd64 2.31-0ubuntu9.2 [10,5 MB]
.
.
.

After this you can install rStudio using sudo gdebi [donwled deb file]

IgnacioNC
  • 311
  • 2
  • 7
9

After reading some posts, I took a look of this one https://askubuntu.com/questions/1337617/unable-to-install-libclang-on-20-04-lts and applied the solution that said:

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

After that, I launched the following to correct the broken installation:

sudo apt --fix-broken install

Having done that, I launched again the dpkg script and it worked for me:

sudo dpkg -i rstudio-2021.09.0-351-amd64.deb

Hope it can help to all of you that has this problem.

Diego Galocha
  • 310
  • 4
  • 8
  • This solved my problem to when I moved to Ubuntu 21.10 and Rstudio 1.4 and R 4.0.4. The R studio problems included not being able to save changes in code files and no response to File>Newfile. Some functions like Dygraph plots would work if they were part of a script file only not interactively. Your solution was appropriate. – user2004198 Jan 21 '22 at 18:09
  • Thanks a lot! using sudo dpkg -i instead of sudo gdebi solved it for me :) – starryn1ght Mar 10 '22 at 18:38
  • I use Linux Mint 20.3 Una base: Ubuntu 20.04 focal. The 'sudo apt-get install libc6=2.31-0ubuntu9.2 libc6:i386=2.31-0ubuntu9.2' returns E: Version "2.31-0ubuntu9.2" for "libc6" has not been found | Version "2.31-0ubuntu9.2" for "libc6:i386" has not been found. – Antoni Jun 05 '22 at 13:13