Hi, I have installed R 4.3.2 Eye Holes in an Ubuntu server (20.04.06 LTS), as a first step for the installation of RStudio Server (free version) and Posit Connect (licensed version). I followed these instructions posit at co/download/rstudio-server/.
In particular, I used these commands cran dot rstudio at com/bin/linux/ubuntu/
# update indices
sudo apt update -qq
# install two helper packages we need
sudo apt install --no-install-recommends software-properties-common dirmngr
# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# Fingerprint: E298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
sudo apt install --no-install-recommends r-base
Note that these instructions are contradicting these other Posit instructions Posit - Install R - Posit Documentation, where a download and installation of a .deb file is advised.
apt install completes the installation of R 4.3.2 without errors. However, when I launch R from the console, I get the following error message Error: 32:1 unexpected '}' , which is puzzling.
If I open a session in RStudio Server, I get the same error, but I can also see a preloaded r object in the environment with an URL with "https://cloud.r-project at org" as string value.
This seems like a problem with your startup files, look at the content of your Rprofile.site and .Rprofile files, one of them is executing invalid R code at the start of your R session.
If you can't still get output for R --version or just execute R typing R,
verify this file
nano /etc/environment
The `/etc/environment` file [normally contains only this line](https://askubuntu.com/questions/866161/setting-path-variable-in-etc-environment-vs-profile):
```shell
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
Following all these steps, I managed to fix my issue. I am leaving these notes here to help the community, thanks.