Wednesday, May 8, 2024
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1279  / 1 Year ago, tue, february 28, 2023, 10:29:18

I wanted to install R with Rstudio to start learning, but I found many problems in the way, I'll explain as much as i can below.


So I went to the CRAN Project website https://cran.r-project.org/ and followed their instructions to install R on my laptop.


# update indices
apt update -qq
# install two helper packages we need
apt install --no-install-recommends software-properties-common dirmngr
# import the signing key (by Michael Rutter) for these repo
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

apt install --no-install-recommends r-base

After that, I go to RStudio webpage and download rstudio-server-1.4.1717-amd64.deb. First I tried to install it with the GUI but the following message appeared:



GPG error: https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/
InRelease: The following signatures couldn't be verified because the
public key is not available: NO_PUBKEY 51716619E084DAB9


The repository 'https://cloud.r-project.org/bin/linux/ubuntu
focal-cran40/ InRelease' is not signed.


Updating from such a repository can't be done securely, and is
therefore disabled by default.


See apt-secure(8) manpage for repository creation and user
configuration details.



Then I tried to install it with sudo apt install ./rstudio-server-1.4.1717-amd64.deb and the following happened:


Note, selecting 'rstudio' instead of './rstudio-1.4.1717-amd64.deb'
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:
rstudio : Depends: libclang-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Finally, as I found many tutorials installing with gdebi, I gave it another shot:


gdebi rstudio-1.4.1717-amd64.deb 

Which yields:


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

So apparently something is going on with libclang-dev, I tried to install it:


sudo apt install libclang-dev

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:
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.

So I tried to install libclang-10-dev but it takes me to another dependency problem similar to the one showed here. I don't think this chain of problems is going to end soon to do it manually.


The last pieces of information I can give you:


When I run rstudio it says command not found.


And now when I do apt update I get the same message as above starting with the "GPG"


The final piece of information I can provide is that when I run R in the command line, I can use R-language from there.


If you happen to know anything I can do to fix this, I'd appreciate it.


More From » software-installation

 Answers
5

To resolve the installation problem, I found the following:


https://stackoverflow.com/questions/67383617/unable-to-install-rstudio-cannot-install-libclang-dev


You first need to install aptitude


sudo apt install aptitude

Then you can run


sudo aptitude install clang

Say No to the first question, Yes to the second.


Then you can go and install RStudio with gdebi.


[#1397] Wednesday, March 1, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ightrushi

Total Points: 129
Total Questions: 125
Total Answers: 127

Location: French Southern and Antarctic Lands
Member since Fri, Jan 6, 2023
1 Year ago
;