1

I needed to upgrade R ver 3.5.3 to 4.0.2 for some dependency issues. I uninstalled it with

sudo apt-get purge r-base r-base-core r-* several times, it seemed OK but I realized that I wasn't completely successful.

After some hours of research online, trying different removal commands, I also deleted folders usr/local/lib/R/site-library and /usr/local/lib/R/library (which I regret doing it) and tried a fresh install by adding Ubuntu 18.04(bionic) cran mirror repositories (which is said to be compatible with Mint 19) for R ver 4.0.

Installing updated version (4.0.2) seems good but whenever I run R from cli it gives following error: Fatal error: unable to open the base package when I check the version with R --version it reports version 3.5.3 installed I've tried adding cran-35 repositories to install version 3.5.3 again but no luck. I am stuck with broken R version 3.5.3 and can't do anything else.

I am frustrated how a single update can be this hard. I am using Ubuntu 18.04 for a long time but don't have any experience with Mint flavor of it. This is our workstation to perform statistical analysis which has many users, so I need to fix it somehow.

Any help or opinion is very appreciated!

3 Answers3

2

all of these commands should uninstall r

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

but it seems you are still having issues with some leftover files, if possible, try running .libPaths() or R -e '.libPaths() to view leftover package installations, and then try deleting those folders.

from: Complete remove and reinstall R, including all packages

Avanti
  • 21
  • 1
  • 1
    Unfortunately I've already removed `r-base-core` and `r-base` packages and 2 folders where `.libPaths()` pointed out previously. For now I can not run `R -e libPaths()` outside R shell or `libPaths()` within R, because R is broken. – özgün özalay Jul 27 '20 at 19:35
0

I gave up on Linux Mint and installed Ubuntu 20.04. R 4.0.2 works out of the box and the problem is solved.

0

I have the same problem today. I did spend hours trying to solve.

I solved it removing the folders manually:

> .libPaths()
[1] "/home/USER/R/x86_64-pc-linux-gnu-library/4.0" "/usr/local/lib/R/site-library"                    
[3] "/usr/lib/R/site-library"                           "/usr/lib/R/library"      
``

You will need sudo permissions.
RxT
  • 486
  • 7
  • 17