Install Debian Linux and R on Android
In fact, through third-party software on the Android tablet, you can already provide many tools similar to General Desktop Linux systems. Common Firefox, VLC, LibreOffice, and terminal simulators all have the Android version. In combination with Busybox, most coreutils tools are available, there are even one-stop development tool solutions such as Terminal IDE (but Android 5.0 + is not supported ). If you want a desktop-level experience, such as the R language environment you want to use, it is better to install a complete Linux environment.
On the Android platform, if Unlock Bootloader has the root permission, you can install a variety of Linux environments in a large way, either completely or in depth, and there are also a lot of online tutorials, I will not go into details. The method described in this article is:
- No need for root, no need to modify system partitions or Bootloader;
- The Debian Linux ARM version is installed normally. It can be updated from the official repository and is compatible with third-party backport repositories;
- Multiple Linux distributions are allowed to coexist and can be easily deleted or rebuilt without worrying about exceptions on the system or SD card.
First, give the role GNURoot and GNURoot Wheezy. The former provides a virtual root file system at the application level, allowing you to fine-tune the Desktop Linux release on it; the latter is obviously the Debian Wheezy version for it.
GNURoot itself supports multiple Linux distributions, which are also commonly used in Fedora. However, since the packaging is old and does not maintain Fedora 17, it is not recommended. For the version of Debian WheezyX, please wait.
The usage of GNURoot is quite intuitive. In the first step, select the root file system to be created. If the previous mentioned Wheezy is not installed, go to the Play Store page to prompt installation. After the creation is complete, select start in step 2. Remember to check the "Launch As Fake Root" option. The third option is to delete the root file system. After you click it, the selected root file system will be deleted cleanly. It is estimated that you will not click it now...
However, before clicking start, it is best to confirm that you have prepared a suitable input device, because only a terminal simulator is coming to you, and many terminal operations are required to install R. If you have a Bluetooth Keyboard, we recommend that you use this Hacker's Keyboard virtual Keyboard, which provides frequently-used buttons on many terminals.
The root file system of Debian Wheezy was generated a little earlier, so of courseapt-get
Upgrade to the latest version. In addition, suchless
And other tools such as mongovim are correctly installed. Notes:
- By default, logon is the root account;
- Devices such as the host's internal storage and SD memory card are mounted
/storage
;
- Due to permission limitations of the Android system, only internal storage can be written, and external SD cards cannot be written;
- Programs, including GNURoot and GNURoot Wheezy, cannot be moved to the SD card because there is no concept of executable permission on the SD card.
Because Debian manages Stable, to use the latest R, you must use the backport repository. According to Debian Package for R Software, add the following Warehouse Information/etc/apt/sources.list
File end:
deb http://<favorite-cran-mirror>/bin/linux/debian wheezy-cran3/
For the next network, it is both the following address:
deb http://mirrors.ustc.edu.cn/CRAN/bin/linux/debian wheezy-cran3/
Passecho
You can easily add the content to the end of the file.
Then add the encryption public key:
apt-key adv --keyserver keys.gnupg.net --recv-key 381BA480
The installation is as follows:
apt-get update
apt-get install r-base r-base-dev
This process is long. On the one hand, it is because of the speed of accessing Debian FTP, and on the other hand, it is time to install and unpackage. After waiting patiently or getting started, you can use the R language on the tablet happily!
If you are used to using graphical IDE Rstudio, you need to be familiar with the R terminal:
- Run the script
Rscript
, RatherR CMD BATCH
.
- You can use help. start () to start the HTML help manual page, which can be viewed in a browser in the Android system environment.
- Similarly, graphics and tables can be embedded in Shiny to output to the Web page, and then viewed in the Android browser.
Finally, let's talk about the same author's WheezyX and GNURoot Debian. The former is to initialize a vnc service at startup, so that you can use a local or remote VNC client to view the X graphical interface. After trying to install the LXDE desktop environment on its basis, the LXDE cannot be started after a long wait. The latter is the new work of the author. According to the instructions, it is a new combination. However, according to the comments, there are still many problems to be addressed.
After such a great deal, I feel that there are still a lot of things on the Android tablet, especially for Linux users. If you have more experience or experience, you may wish to contribute or share it in your comments.