Marco
Marco

Reputation: 53

R installation on Ubuntu, how to fix this error message?

I'm quite new to Unix systems and I just can't understand why I'm having this problem during the installation of R on Ubuntu 20.04 focal fossa.

I have installed R using the following procedure:

When I run R in the terminal this message shows up:

/usr/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

The same error is shown every time I try to install an r package. For every package I try to install the error "installation of package had non-zero exit status" shows up and the reason the package is not installed is the absence of the directory showed above.

Is there a solution to this problem? Sorry for the poorness of my indications, if other information is needed I will update my question with screenshots or command lines.

Edit: as requested in the comments I post the output of the command apt-cache policy r-base-core

  r-base-core:
  Installed: 4.2.0-1.2004.0
  Candidate: 4.2.0-1.2004.0
  Version table:
 *** 4.2.0-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
        100 /var/lib/dpkg/status
     4.1.3-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.1.2-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.1.1-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.1.0-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.5-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.4-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.3-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.2-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.1-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     4.0.0-1.2004.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages
     3.6.3-2 500
        500 http://it.archive.ubuntu.com/ubuntu focal/universe amd64 Packages

Thanks in advance.

Upvotes: 1

Views: 1033

Answers (1)

raghu
raghu

Reputation: 21

sudo apt-get --purge remove r-base r-base-dev r-base-core
sudo apt autoremove

I used the above lines to totally remove R, then reinstall r-base r-base-dev r-base-core this will automatically re-write the /usr/lib/R/. This should work without errors.

Upvotes: 1

Related Questions