Installing the latest R and RStudio on a Chromebook

Note 1) This instruction is based on plus my own trial and error experience. His/her instruction was awesome other than a couple of minor typos that would cause some confusion during the installation. 2) I assume that you are planning to use the Linux environment that came with your Chromebook.

Installation environment

  • Chromebook: HP Chromebook 15.6 (4GB RAM)
  • ChromeOS: Version 80.0.3987.128 (Official Build) (64-bit)
  • Linux Distribution: Debian 9
    • To turn on the Linux environment in your Chromebook, please refer to this link.

Linux CodeInstalling R

sudo apt search r-base | grep ^r-base
sudo apt install -y gnupg2
sudo apt-key adv --keyserver --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
sudo vi /etc/apt/sources.list

The line of code above will open up a document where you will need to add a line of code at the end of the document. The code is shown below (the original instruction from omitted the ‘/’ at the end, which I am not sure whether it is a typo or because he/she is using a different system). In case I did not add the last ‘/’, it reported an error and the source is not recognized during the subsequent use.

It adds the repository to the existing pool of the repository. In case you have never used a vi text editor.
1) ‘shift+g’ will take you to the last line;
2) ‘o’ will add a new line and the editor will turn into the insert mode;
3) ‘esc’ will exist the insert mode;
4) ‘:wq’ will save and exit.

deb stretch-cran35/
sudo apt update
sudo apt upgrade

Finally, installing r base.

sudo apt install -y r-base r-base-dev

Linux Code – Installing RStudio

Download the latest RStudio package from and save it as rstudio.deb. You can replace the URL with the lastest one from website.

curl -o rstudio.deb

Then, I install the package.

sudo dpkg -i rstudio.deb

Mine encountered a problem after the installation. Specifically, when clicked on the icon, RStudio won’t start and a loading circle continues to hover on the surface of the RStudio icon. When tried to use the terminal to load, the terminal showed the following message.

#This part is an error message, not code. 
rstudio: error while loading shared libraries: cannot open shared object file: No such file or directory

The problem is fixed by the following line of code.

sudo apt install libnss3


Screenshot: RStudio on my Chromebook


  1. This was very much needed. Thank You!!
    I had to install and uninstall a couple of times before it got to working. Initially it would just appear and then disappear.

Leave a Reply

%d bloggers like this: