paint-brush
How To Setup Linux Terminal on Androidby@swapnilgore
13,774 reads
13,774 reads

How To Setup Linux Terminal on Android

by Swapnil GoreJanuary 8th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

With few modifications, you can also use the terminal on your android device similar to the way you do on your Linux system. Termux is one of the most popular android terminals and has a good active community to help you if do run into some problems. The OS is primarily Linux based, so with few modifications you can use it on your Android device. The terminal is a command line interface used to interact with computers. With MacOS, Linux and even sometimes windows, interacting with the terminal is common practice for developers.

Company Mentioned

Mention Thumbnail
featured image - How To Setup Linux Terminal on Android
Swapnil Gore HackerNoon profile picture

A terminal is a command line interface used to interact with computers. With MacOS, Linux and even sometimes windows, interacting with the terminal is a pretty common practice for developers. But, not so much with Android.

Android (the OS), is primarily Linux based, so with few modifications, you can also use the terminal on your android device similar to the way you do on your Linux system.

1) Install termux from google playstore

Termux is one of the most popular android terminals and has a good active community to help you if do run into some problems.

install termux on your android device

(if you have any questions regarding termux, refer to their wiki before anything else)

2) Enable Storage access

open the termux app, and run the following command :

termux-setup-storage

3) Make sure termux is running

try the following command :

echo 'hello world'

on pressing the enter key on your phone, hello world should be printed on the line below

4) Installing ubuntu-in-termux

  • update termux packages (including -y so it doesn't ask for confirmation when installing) :
apt-get update && apt-get upgrade -y

(termux, similar to a lot of linux distributions, also comes with the apt package manager for installation and management of softwares and libraries)

  • Install wget
pt-get install wget -y

( it is a software package that is used to get stuff from the internet, we will need this later)

  • Install proot
apt-get install proot -y

( we need this to use our current directory as the root system for ubuntu)

  • Install git
apt-get install git -y
  • Go to the home folder
cd ~
  • Download the files from this repo using git
  • check if files are fetched properly
ls

(this should return a list of files in the current directory)

  • Travel into the ubuntu-in-termux directory
cd ubuntu-in-termux
  • make the ubuntu.sh shell script executable
chmod +x ubuntu.sh
  • run the script
./ubuntu.sh
  • start ubuntu !
./startubuntu.sh
  • how to exit
exit

:)

So there you have it, a terminal for your android phone along with a bash shell with ubuntu environment. Use your new found power wisely !