Rstudio not working on WSL

Hello:

I installed rstudio on WSL 2 (Ubuntu 20.04) via

sudo apt install rstudio --classic

Then I get the following error report:

R Session Startup Failure Report

RStudio Version

RStudio 2025.05.1+513 "Mariposa Orchid " (ab7c1bc7, 2025-06-01) for Ubuntu Jammy

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2025.05.1+513 Chrome/132.0.6834.210 Electron/34.5.1 Safari/537.36

Error message

The R session had a fatal error.

2025-08-05T19:21:27.764728Z [rsession-root] ERROR r error 4 (Error in dyn.load(file, DLLpath = DLLpath, ...) : ||| unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so':||| /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_asRboolean|||) [errormsg: Error in dyn.load(file, DLLpath = DLLpath, ...) : ||| unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so':||| /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_asRboolean|||]; OCCURRED AT rstudio::core::Error rstudio::r::exec::{anonymous}::evaluateExpressionsUnsafe(SEXP, SEXP, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::{anonymous}::EvalType) src/cpp/r/RExec.cpp:251

2025-08-05T19:21:27.764728Z [rsession-root] ERROR r error 4 (Error in dyn.load(file, DLLpath = DLLpath, ...) : ||| unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so':||| /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_asRboolean|||) [errormsg: Error in dyn.load(file, DLLpath = DLLpath, ...) : ||| unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so':||| /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_asRboolean|||]; OCCURRED AT rstudio::core::Error rstudio::r::exec::{anonymous}::evaluateExpressionsUnsafe(SEXP, SEXP, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::{anonymous}::EvalType) src/cpp/r/RExec.cpp:251

Process Output

The R session exited with code 2.

Error output:

2025-08-05T19:21:27.764728Z [rsession-root] ERROR r error 4 (Error in dyn.load(file, DLLpath = DLLpath, ...) : |||  unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so':|||  /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_asRboolean|||) [errormsg: Error in dyn.load(file, DLLpath = DLLpath, ...) : |||  unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so':|||  /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_asRboolean|||]; OCCURRED AT rstudio::core::Error rstudio::r::exec::{anonymous}::evaluateExpressionsUnsafe(SEXP, SEXP, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::{anonymous}::EvalType) src/cpp/r/RExec.cpp:251


Standard output:

[No output emitted]

Logs

/root/.local/share/rstudio/log/rsession-root.log

]; OCCURRED AT rstudio::core::Error rstudio::r::exec::{anonymous}::evaluateExpressionsUnsafe(SEXP, SEXP, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::{anonymous}::EvalType) src/cpp/r/RExec.cpp:251; LOGGED FROM: int rstudio::r::session::RReadConsole(const char*, CONSOLE_BUFFER_CHAR*, int, int) src/cpp/r/session/RStdCallbacks.cpp:296
2025-08-05T19:21:27.764803Z [rsession-root] ERROR R SUICIDE: 2025-08-05T19:21:27.764728Z [rsession-root] ERROR r error 4 (Error in dyn.load(file, DLLpath = DLLpath, ...) : |||  unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so':|||  /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_asRboolean|||) [errormsg: Error in dyn.load(file, DLLpath = DLLpath, ...) : |||  unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so':|||  /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_asRboolean|||]; OCCURRED AT rstudio::core::Error rstudio::r::exec::{anonymous}::evaluateExpressionsUnsafe(SEXP, SEXP, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::{anonymous}::EvalType) src/cpp/r/RExec.cpp:251; LOGGED FROM: void {anonymous}::rSuicide(const string&) src/cpp/session/SessionMain.cpp:1377
2025-08-05T19:21:27.764803Z [rsession-root] ERROR R SUICIDE: 2025-08-05T19:21:27.764728Z [rsession-root] ERROR r error 4 (Error in dyn.load(file, DLLpath = DLLpath, ...) : |||  unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so':|||  /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_asRboolean|||) [errormsg: Error in dyn.load(file, DLLpath = DLLpath, ...) : |||  unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so':|||  /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_asRboolean|||]; OCCURRED AT rstudio::core::Error rstudio::r::exec::{anonymous}::evaluateExpressionsUnsafe(SEXP, SEXP, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::{anonymous}::EvalType) src/cpp/r/RExec.cpp:251; LOGGED FROM: void {anonymous}::rSuicide(const string&) src/cpp/session/SessionMain.cpp:1377

I installed R-4.5.1 last week.

Any suggestions much appreciated.

Sincerely,
Erin

I gave it a try and RStudio started for me. Here's what I did:

  • Windows-11:
    • wsl --install Ubuntu-20.04
  • In Linux (WSL):
    • sudo apt install r-base-core
    • sudo snap install rstudio --classic (I had to use snap, you said you used sudo apt install... but that didn't work for me, no such package)
  • rstudio

RStudio started, but was using R 3.6.3 (ancient version in the default Ubuntu 20 packages).

I then installed newer R binaries from CRAN (4.5.1) and RStudio still started fine. So, not sure what's happening on your system, but at least you know it can work...

Does R start correctly for you in a terminal? The path /usr/local/lib/R/library/grDevices/libs/grDevices.so looks like it might be incorrect.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.