Hackernoon logoHow To Setup Linux Terminal on Android by@swapnilgore

How To Setup Linux Terminal on Android

Swapnil Gore Hacker Noon profile picture

@swapnilgoreSwapnil Gore

Saving the world by solving one syntax error a day

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 !

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.