Installation of RStudio impossible in Ubuntu 19.04 - Dependency issue

Hello, I am trying to install RStudio on my Ubuntu 19.04 laptop, using the "rstudio-1.2.1335-amd64.deb" file. When I try to install it, the console gives the message :

Reading package lists... Done
Building dependency tree        
Reading state information... Done
Reading state information... Done
Ce paquet ne peut pas être installé
Cannot install 'libclang-dev'

I have tried to install the package libclang-dev manually, but it gave me this message (in french) :

Les paquets suivants contiennent des dépendances non satisfaites :
libclang-dev : Dépend: libclang-8-dev (>= 8~) mais ne sera pas installé
E: Impossible de corriger les problèmes, des paquets défectueux sont en mode « garder en l'état ».

Which translates as :

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

I have tried to install the R Studio Server, but was met with the same issue.

I also tried the command :

apt-get -f install

But it only removed the package I have been trying to install.

I am using Ubuntu 19.04 and am trying to install the latest version of R Studio available for Ubuntu. I was able to install R without any difficulty.

There might be a very easy solution or I may be doing the installation wrong. I am both new to Ubuntu and R.

Thank you very much for your help.

Cleophee

1 Like

The error message is one of the most puzzling that you run across in R because it appears to suggest that libclang-8-dev is an R package, which it isn't.

It's a compiled library in Fortran, C or C++ on your 19.04 that isn't installed with Ubuntu by default.

Open the Ubuntu terminal

sudo apt-get update
sudo apt install libclang-8-dev

apt will either install it and you can go back to installing RStudio or it will tell you that the latest version is already installed, in which case we have a PATH issue to solve.

I have the same set-up, so I can assure you it's possible.

1 Like

@Cleophee Welcome! That is a super frustrating error.

Don't be discouraged because there is no "very easy solution" to this. Each Ubuntu release has different default versions of system libraries, which can make it difficult to install RStudio. For this reason, the RStudio team only supports the LTS releases. Since you are attempting to use the binary built for Ubuntu Bionic (18.04), this will require some troubleshooting.

I did some investigating, and here are my thoughts/suggestions.

I was able to build RStudio in the Docker image ubuntu:19.04 using the following steps:

apt update && apt upgrade -y
export DEBIAN_FRONTEND=noninteractive
apt install -y \
  gdebi r-base wget
wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-1.2.1335-amd64.deb
gdebi rstudio-1.2.1335-amd64.deb

Did you follow a similar strategy?

And even though it successfully installed, I received error message when running rstudio --help. Following the advice in Installation error: cannot find libsmime3.so and https://github.com/rstudio/rstudio/issues/4610, I was able to install the missing libraries with:

apt install -y \
  libasound2 \
  libnss3 \
  libegl1-mesa \
  libxkbcommon-x11-0 \
  libgl1-mesa-glx \
  libxtst6

However, I still got a Qt error, but this was likely due to missing X11 libraries in the Docker image (i.e. this shouldn't affect your Ubuntu Dekstop installation):

rstudio --help
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)

Another guess for your issue is that you have a separate package installed that depends on a different versions of libclang-8-dev. You can view reverse dependencies with apt-cache rdepends. For example, in the Docker container, the only package that depends on libclang-8-dev and libclang-dev is RStudio.

$ apt-cache rdepends --recurse --installed libclang-8-dev
libclang-8-dev
Reverse Depends:
  libclang-dev
libclang-dev
Reverse Depends:
  rstudio
rstudio
Reverse Depends:

When you run the above on your machine, do you find other installed pacakges?

Thank you, @technocrat so much for your answer. I have tried the code you wrote (installing libclang-8-dev).
However, I found error messages of the same kind. I have also tried to install all these packages :
libclang-dev, libclang-8-dev, libobjc-8-dev, libobjc4, libclang-common-8-dev, lib32gcc1, lib32stdc++6

Each of them linking to another. The package gcc-9-base was the last one on the list and was already installed (the latest version).

Is this enough to try and solve the PATH issue ?

Thank you.

Cleophée

1 Like

@jdblischak, Thank for your answer.

I have tried the code you suggested, but R-Studio was still uninstalled.

The reverse dependencies give the result :

apt-cache rdepends --recurse --installed libclang-8-dev
libclang-8-dev
Reverse Depends:

apt-cache rdepends --recurse --installed libclang-dev
libclang-dev
Reverse Depends:

apt-cache rdepends --recurse --installed rstudio
<rstudio>

Without '--recurse --installed'

apt-cache rdepends libclang-dev
libclang-dev
Reverse Depends:
  librust-clang-sys-dev
  rstudio

apt-cache rdepends libclang-8-dev
libclang-8-dev
Reverse Depends:
  libclang-dev

I don't exactly know what it means. Is this the expected result ?

Thank you,

Cléophée

@Cleophee Could you please copy-paste all of the output you receive when you try to install RStudio with gdebi?

I think it makes sense given your description. The flag --installed limits the results to only installed packages. Since RStudio failed to install, it isn't listed when you specify --installed. It appears that libclang-dev isn't installed either. This is disappointing because I was hoping it would list some other software that you had installed that was conflicting with RStudio.

Here are some additional commands to try to understand why you can't install libclang:

# List any installed libclang packages
apt list --installed 'libclang*'
# See the update information
apt-cache policy libclang-dev
apt-cache policy libclang-8-dev

Could you please copy-paste the output you receive?

Here is what I get when I run the above in the Docker container:

$ apt list --installed 'libclang*'
Listing... Done
libclang-8-dev/disco,now 1:8-3 amd64 [installed,automatic]
libclang-common-8-dev/disco,now 1:8-3 amd64 [installed,automatic]
libclang-dev/disco,now 1:8.0-48~exp1ubuntu1 amd64 [installed,automatic]
libclang1-8/disco,now 1:8-3 amd64 [installed,automatic]
$ apt-cache policy libclang-dev
libclang-dev:
  Installed: 1:8.0-48~exp1ubuntu1
  Candidate: 1:8.0-48~exp1ubuntu1
  Version table:
 *** 1:8.0-48~exp1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu disco/universe amd64 Packages
        100 /var/lib/dpkg/status
$ apt-cache policy libclang-8-dev
libclang-8-dev:
  Installed: 1:8-3
  Candidate: 1:8-3
  Version table:
 *** 1:8-3 500
        500 http://archive.ubuntu.com/ubuntu disco/universe amd64 Packages
        100 /var/lib/dpkg/status

Sorry that didn't work on your installation. @jdblischak has good suggestions that I would try next. Until we know that all of the required non-R libraries are installed, it's too early to worry about any potential PATH issues.

gdebi is another package installer, that is better about handling dependency issues

sudo apt install gdebi

Then go to the folder with the download of RStudio and try

gdebi [name of the RStudio file ending in deb]

@jdblischak is asking you to copy the messages from that command

1 Like

@jdblischak

Here is the message I receive when I try to install R Studio :

sudo gdebi rstudio-1.2.1335-amd64.deb
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Reading state information... Done
Ce paquet ne peut pas être installé
Cannot install 'libclang-dev'

The list of the libclang packages is empty :

apt list --installed 'libclang*'
Listing... Done

The update informations :

apt-cache policy libclang-dev
libclang-dev:
  Installed : (none)
  Candidate : 1:8.0-48~exp1ubuntu1
  Version table :
     1:8.0-48~exp1ubuntu1 500
        500 http://fr.archive.ubuntu.com/ubuntu disco/universe amd64 Packages

apt-cache policy libclang-8-dev
libclang-8-dev:
  Installed : (aucun)
  Candidate : 1:8-3
  Version table :
     1:8-3 500
        500 http://fr.archive.ubuntu.com/ubuntu disco/universe amd64 Packages

Thank you for your help.

1 Like

@Cleophee OK, so here is a summary of what we have learned so far:

  1. RStudio requires libclang-dev, but you can't install it on your machine (from gdebi)
  2. Other users have been able to install libclang-dev and RStudio on Ubuntu 19.04
  3. Your machine does not have any libclang libraries installed (from apt list --installed)
  4. There is no reverse dependency issue with another software package (from apt-cache rdepends)
  5. libclang-dev is available from your package manager source list (from apt-cache policy)

So we know that libclang-dev is definintely the problem, but it's still unclear what is different about your installation of Ubuntu 19.04 compared to a standard installation.

How did you install Ubuntu 19.04? Was it a fresh install or did you upgrade from a previous version? An Ask Ubuntu user was unable to install clang after upgrading Ubuntu from 18.04 to 19.04, so maybe your issue is related.

2 Likes

Unfortunately, I installed Ubuntu 19.04 using the official ISO image on a bootable usb flash drive. My hard drive was new and empty (with neither the usual pre-installed Windows OS or any previous version of Ubuntu). So it can't (in my case) be caused by an upgrade from 18.04.

Thank you.

1 Like

Maybe you have an incompatible version of clang installed. Could you please check by running the following:

apt list --installed '*clang*'

I got this idea from this GitHub Issue.

1 Like

The result of the code is :

apt list --installed '*clang*'
Listing.... Done

Thank you

1 Like

@Cleophee Sorry, I am officially out of ideas. It's unclear to me why you can't install libclang-8-dev on Ubuntu 19.04. I and others have successfully installed it, and we couldn't find anything among your other installed packages that could possibly be causing the conflict. I'd recommend trying a Ubuntu-focused forum like Ask Ubuntu to specifically ask about installing libclang-8-dev (but be sure to link back to this issue in your post so that others can see what we've already tried).

In the meantime, other options for running RStudio include:

  1. Replace Ubuntu 19.04 with the latest LTS release (currently 18.04). RStudio has a binary specific to Ubuntu 18.04, so this will almost certainly work.
  2. Install Docker, and then run RStudio Server from the Docker container (e.g. using the image rocker/rstudio)
1 Like

@Cleophee Another option would be to install RStudio 1.1, which worked for another user with installation issues (thread).

wget http://download1.rstudio.org/rstudio-1.1.463-amd64.deb

And here is the list of previous versions available for downloading.

I have tried to install the 1.1 version of RStudio, as suggested. It still had dependencies errors :

sudo gdebi rstudio-1.1.463-amd64.deb
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Reading state information... Done
Dependency is not satisfiable: libssl1.0.0|libssl1.0.2

But then I found this post : https://www.reddit.com/r/linux4noobs/comments/6i07ai/rstudio_on_debian_9_stretch/

Their solution was to install libstreamer0.10-0 and libgtreamer-plugins-base0.10-0 and proceed to the installation of rstudio with the instruction to ignore the dependencies issues.

install https://packages.debian.org/jessie/libgstreamer0.10-0
install https://packages.debian.org/jessie/libgstreamer-plugins-base0.10-0
apt-get install r-base
dpkg --ignore-depends=libssl1.0.0 -i rstudio-1.0.143-amd64.deb

Which worked, so I then installed the most recent version of R-Studio.

sudo dpkg --ignore-depends=libclang-dev -i rstudio-1.2.1335-amd64.deb

It seems that it was successfully installed and it opens normally.

I am not sure, however, that ignoring of the dependency conflict will be without consequences and that it will not crash later.

I hope it will be stable enough until the Ubuntu 19.04 compatible version of R-Studio is released.

Thank you very very much for the time you spend finding a solution to my problem :slight_smile:

Cléo.

2 Likes

@Cleophee Great! I'm glad you were able to find a solution. Could you please mark your post above as the solution so that others can jump right to it?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.