Score:2

Successfully download R and Rstudio on ubuntu 18.04, but can't open it,enven on web(8787)

pk flag

I want to use Rstudio on cloud server, and I successfully download R and Rstudio on ubuntu 18.04, but can't open it. I think it is because of the wrong environment variable. And I don't know what to do next.

mengfei@iZ2zeh7tqthaheqrfl87z2Z:/root$ R
R version 4.1.1 (2021-08-10) -- "Kick Things"
Copyright (C) 2021 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.
mengfei@iZ2zeh7tqthaheqrfl87z2Z:/root$ rstudio-server verify-installation
Server is running and must be stopped before running verify-installation

mengfei@iZ2zeh7tqthaheqrfl87z2Z:/root$ rstudio
rstudio: command not found

mengfei@iZ2zeh7tqthaheqrfl87z2Z:/root$ export $PATH
bash: export: `/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin': not a valid identifier

root@iZ2zeh7tqthaheqrfl87z2Z:~# which rstudio-server
/usr/sbin/rstudio-server

Couldn't open rstudio on web(8787)

And I see somneone said it is because of space symbol in PATH, I checked it twice by vi .bashrc, there was no space in PATH.

Hope for your reply. Thank you.

Wang Mengfei avatar
pk flag
Thank you for your edit @N0rbert. I was confusing how to show my question in programming languages, and tried a lot to make it better. Thank you for your help.
N0rbert avatar
zw flag
To be sure, can you please add details - how did you installed R, RStudio and RStudio server? Did you use deb-packages from official site? Please add the output of `dpkg -l | grep rstudio` and `apt-cache policy r-base-dev` to the question. Do you have access to GUI session on server?
cn flag
Ray
If you downloaded it from [here](https://www.rstudio.com/products/rstudio/download-server/debian-ubuntu/), did you try the "Next Steps" at the bottom of this page?
Score:0
zw flag

Technically RStudio and RStudio Server are different software products. The first works on systems with GUI, the second works headless and provides web-interface.

For cloud environment I expect that you need the RStudio Server installation, so below are the steps:

  1. Installation of R

    • using packages from official repositories

      sudo apt-get update
      sudo apt-get install r-base-dev
      
    • using packages from CRAN

      sudo apt install --no-install-recommends software-properties-common dirmngr
      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
      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
      
  2. Installation of RStudio Server

    cd ~/Downloads
    wget -c https://download2.rstudio.org/server/debian9/x86_64/rstudio-server-1.4.1717-amd64.deb
    sudo apt install ./rstudio-server-1.4.1717-amd64.deb
    

    Note: you may also need to install build-essential package on server to get R packages normally compiled when running commands like R -e "install.packages('bookdown')".

  3. Connecting to RStudio Server - open web-browser and point it to http://localhost:8787 (replace localhost with IP or public domain name).

Optionally you can install RStudio desktop by

cd ~/Downloads
wget -c https://download1.rstudio.org/desktop/bionic/amd64/rstudio-1.4.1717-amd64.deb
sudo apt-get install ./rstudio-1.4.1717-amd64.deb

but I'm not sure how it is useful in cloud environment.


References:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.