RStudio is not picking my latest R version

Description of issue -

I have R-4.3.1 and R-4.3.2 installed from source in ~/R with libraries in R/x86_64-pc-linux-gnu-library/4.3. My OS is POP!_OS 22.04 (a variant of Ubuntu 22.04).

I have the R shell wrapper script at
~$ which R
/usr/local/bin/R

I get no error messages, but R started from the shell runs R-4.3.2 , while RStudio runs R-4.3.1.

Furthermore, if I go to the terminal in RStudi and try to start an R session, it failes with these errors
$ R
WARNING: ignoring environment value of R_HOME
/usr/bin/R: line 249: /home/jcarson/R/etc/ldpaths: No such file or directory
/usr/bin/R: line 272: /home/jcarson/R/bin/exec/R: No such file or directory

System Information:

RStudio Desktop
2023.09.1 Build 494

sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Pop!_OS 22.04 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: America/Denver
tzcode source: system (glibc)

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_4.3.2 fastmap_1.1.1 cli_3.6.1 htmltools_0.5.7 tools_4.3.2 rstudioapi_0.15.0
[7] yaml_2.3.7 rmarkdown_2.25 knitr_1.45 digest_0.6.33 xfun_0.41 rlang_1.1.2
[13] evaluate_0.23


Referred here from support.rstudio.com

Hi, have you tried this set up in your ~/.profile?

export RSTUDIO_WHICH_R=/usr/local/bin/R

Source:

Definitely! Sadly, it did not help.

.profile

cat .profile

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

# EXPORTS

# which version of R to use with RStudio
export RSTUDIO_WHICH_R=/usr/local/bin/R 
R startup in RStudio

R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Warning message:
package ‘methods’ was built under R version 4.3.2
During startup - Warning messages:
1: package ‘datasets’ was built under R version 4.3.2
2: package ‘utils’ was built under R version 4.3.2
3: package ‘grDevices’ was built under R version 4.3.2
4: package ‘graphics’ was built under R version 4.3.2
5: package ‘stats’ was built under R version 4.3.2

R startup from console

$ R

R version 4.3.2 (2023-10-31) -- "Eye Holes"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

This topic was automatically closed 42 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.