First of all we need to increase the amount of swap space and to change the default sh from dash to bash.
sudo su service dphys-swapfile stop nano /etc/dphys-swapfile # The default value of CONF_SWAPSIZE in Raspbian is 100. # We will need to change this to: (empty) ,1024, and so on. # After installing RStudio, it would be better to restore # the value of CONF_SWAPSIZE to the initial value in order # to stand a micro SD card long use. service dphys-swapfile start dpkg-reconfigure dash
sudo su apt-get update apt-get upgrade -y apt-get install -y git r-recommended python-dev cd /home/pi/Downloads/ git clone https://github.com/rstudio/rstudio.git cd /home/pi/Downloads/rstudio/dependencies/common/ ./install-common cd /home/pi/Downloads/rstudio/dependencies/linux/ ./install-dependencies-debian #saw java 6 was not installed. installed v7 apt-get install -y openjdk-7-jdk #tried to make install, got an error about dictionaries not installed and rerun install-dependencies cd /home/pi/Downloads/rstudio/dependencies/common/ ./install-common #tried to make install, hangs at "ext:" so I tried manually installing pandoc, which should have been installed earlier, but apparently was not apt-get install -y pandoc #tried to make install, hangs at "ext:" so I tried installing the latest GWT compiler cd /home/pi/Downloads wget http://dl.google.com/closure-compiler/compiler-latest.zip unzip compiler-latest.zip rm COPYING README.md compiler-latest.zip mv closure-compiler-v20170218.jar /home/pi/Downloads/rstudio/src/gwt/tools/compiler/compiler.jar #build and install works! cd /home/pi/Downloads/rstudio/ #remove build if exists rm -r ./build mkdir build cd build cmake .. -DRSTUDIO_TARGET=Server -DCMAKE_BUILD_TYPE=Release make install
# Additional install steps sudo useradd -r rstudio-server sudo cp /usr/local/lib/rstudio-server/extras/init.d/debian/rstudio-server /etc/init.d/rstudio-server sudo chmod +x /etc/init.d/rstudio-server sudo ln -f -s /usr/local/lib/rstudio-server/bin/rstudio-server /usr/sbin/rstudio-server sudo chmod 777 -R /usr/local/lib/R/site-library/ # Setup locale sudo apt-get install -y locales sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 #echo 'export LANG=en_US.UTF-8' >> ~/.bashrc #echo 'export LANGUAGE=en_US.UTF-8' >> ~/.bashrc ## Clean the system of packages used for building #sudo apt-get autoremove -y cabal-install ghc openjdk-7-jdk pandoc libboost-all-dev #sudo rm -r -f ~/rstudio-$VERS #sudo apt-get autoremove -yFinally, according to [5], we shall install pandoc-citeproc and remove files as follows.
sudo apt-get install pandoc-citeproc sudo rm /usr/local/lib/rstudio-server/bin/pandoc/pandoc sudo rm /usr/local/lib/rstudio-server/bin/pandoc/pandoc-citeproc
#Before starting the server, we need to reload daemon. sudo systemctl daemon-reload # Start the server sudo rstudio-server start # Go to localhost:8787
sudo su apt-get update apt-get upgrade -y apt-get install -y git r-recommended python-dev cd /home/pi/Downloads/ git clone https://github.com/rstudio/rstudio.git cd /home/pi/Downloads/rstudio/dependencies/common/ ./install-common cd /home/pi/Downloads/rstudio/dependencies/linux/ ./install-dependencies-debian #saw java 6 was not installed. installed v7 apt-get install -y openjdk-7-jdk #tried to make install, got an error about dictionaries not installed and rerun install-dependencies cd /home/pi/Downloads/rstudio/dependencies/common/ ./install-common #tried to make install, hangs at "ext:" so I tried manually installing pandoc, which should have been installed earlier, but apparently was not apt-get install -y pandoc #tried to make install, hangs at "ext:" so I tried installing the latest GWT compiler cd /home/pi/Downloads wget http://dl.google.com/closure-compiler/compiler-latest.zip unzip compiler-latest.zip rm COPYING README.md compiler-latest.zip mv closure-compiler-v20170218.jar /home/pi/Downloads/rstudio/src/gwt/tools/compiler/compiler.jar #build cd /home/pi/Downloads/rstudio/ #remove build if exists rm -r ./build mkdir build cd buildFor the second half, we need to install some packages and to edit some files.
apt-get install -y qt5-default libqt5svg5-dev libqt5sensors5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev qtpositioning5-dev mv /root/Qt5.4.0/5.4/gcc/bin /root/Qt5.4.0/5.4/gcc/bin_orig mv /root/Qt5.4.0/5.4/gcc/lib /root/Qt5.4.0/5.4/gcc/lib_orig ln -s /usr/lib/arm-linux-gnueabihf/qt5/bin /root/Qt5.4.0/5.4/gcc/bin ln -s /usr/lib/arm-linux-gnueabihf /root/Qt5.4.0/5.4/gcc/lib nano /root/Qt5.4.0/5.4/gcc/lib/cmake/Qt5Core/Qt5CoreMacros.cmake #change COPY_ONLY to COPYONLY # #sed -i -e s/COPY_ONLY/COPYONLY/g /root/Qt5.4.0/5.4/gcc/lib/cmake/Qt5Core/Qt5CoreMacros.cmake nano /home/pi/Downloads/rstudio/src/cpp/desktop/CMakeLists.txt # change "cmake_policy(SET CMP0020 OLD)" to "cmake_policy(SET CMP0043 OLD)" #sed -i -e s/CMP0020/CMP0043/g /home/pi/Downloads/rstudio/src/cpp/desktop/CMakeLists.txt cd /home/pi/Downloads/rstudio/build cmake .. -DRSTUDIO_TARGET=Desktop -DCMAKE_BUILD_TYPE=Release make -j3 install &> install_output #According to [5] sudo apt-get install pandoc-citeproc sudo rm /usr/local/lib/rstudio/bin/pandoc/pandoc sudo rm /usr/local/lib/rstudio/bin/pandoc/pandoc-citeproc #When trying to run, saw : libEGL warning: DRI2: failed to authenticate #According to [6], make the following symbolic links. #(See Addendum below.) #sudo apt-get install chromium-browser LIBEGL=`sudo find /usr/lib/chromium-browser -name libEGL.so` LIBGLES=`sudo find /usr/lib/chromium-browser -name libGLESv2.so` sudo ln -sf $LIBEGL /usr/lib/arm-linux-gnueabihf/libEGL.so sudo ln -sf $LIBEGL /usr/lib/arm-linux-gnueabihf/libEGL.so.1 sudo ln -sf $LIBGLES /usr/lib/arm-linux-gnueabihf/libGLESv2.so sudo ln -sf $LIBGLES /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2
#How to run RStudio Desktop /usr/local/lib/rstudio/bin/rstudioWe can use Raspberry Pi Menu as follows.