How to Install and Run Ubuntu Shell in Termux

 

Termux Ubuntu: What is the use of Termux Ubuntu?


Well, the first reason to use termux ubuntu shell is to experience and get familiar with the Ubuntu environment. If you have never used ubuntu then you should at least get familiar with it because most of the corporate sectors use ubuntu for privacy. Ubuntu also has its own package manager "apt-get" which we also use sometimes in termux. By using the Ubuntu version of CLI you will get to know a lot more about Linux and even understand the file structure. If some tool works in ubuntu and doesn't work in termux, try running it with Termux Ubuntu shell and it will work fine.


While using termux we install the best available tools for our termux and everything works perfectly until we install some broken tool that messes up all the settings and files of our termux that we cannot recover. With the use of Termux Ubuntu or Termux Kali Linux shell, you can avoid those kinds of issues because if anything messes up inside the termux ubuntu shell then it's only going to affect that container and not the entire file system or bash files of termux. You can use termux shell for your main workspace and for experiments you can use ubuntu shell. 



Install Ubuntu Shell in Termux :

If you are in a hurry, then you can just copy-paste the below command, and it will be installed in your termux applications.


Step 1: (Update termux):


Before installing any tool in termux first we will update all the Pre-installed packages in termux, so we won't face any errors while using the tool.


apt-get update && apt-get upgrade -y


This command will update all the preinstalled packages in termux.




Step 2: (Install wget proot and git):


To install the tools and repos from the internet we have to install a few packages. we will install wget to get the scripts and a few files from the internet. we will install proot in termux to create a separate container environment for our ubuntu os. and lastly we will install git in termux so that we can get the project files from GitHub. just copy and paste the below commands to install them. 


apt-get install wget proot git -y


Step 3: (Go to HOME folder in Termux):


This is going to be a really important tool and to make it all work with my configuration you have to install termux shell in the home directory of the termux, just paste the below command and you will be in your home directory. 


cd


Step 4: (Fetch the script from the github):


This command will clone the termux ubuntu shell from the github to your termux terminal. simple copy paste the command and press enter. This is a really small project so it won't take any time at all. It will be downloaded almost instantly.


git clone https://github.com/MFDGaming/ubuntu-in-termux.git



Step 5: (Go to the script directory):


Now if you "ls" your terminal, you will have a new folder name ubuntu-in-termux, you have to get inside that folder to run the installation script. just paste the below command and you will be inside the ubuntu-in-termux folder. 


cd ubuntu-in-termux



Step 6: (Give execution permission to the script):


To give this file execution permissions you have to run chmod command, this will allow the script to install the ubuntu shell in your termux terminal. run this command.


chmod +x ubuntu.sh


Step 7: (Execute the script):


Execute the installation script, this will install the ubuntu shell in your termux terminal. enter this command and wait for the script completely install. 


./ubuntu.sh -y


Step 8: (start ubuntu shell):


Everything is done, and now you can enter into your ubuntu shell, just type the below command and you will see that you are in ubuntu as a root user.


./startubuntu.sh


Run and Customize Ubuntu shell in Termux:


These are the few customizations that you can do to kick start your journey of exploring Ubuntu shell.


Run Ubuntu shell in Termux:


If you restart your termux and you want to run the ubuntu again you have to first change your working directory to the ubuntu-in-termux folder, and then you have to run the startubuntu.sh file. so you have to execute below two commands. 


cd ubuntu-in-termux


 ./startubuntu.sh


This is a fine way to enter your ubuntu shell but that is not the only way.



Shortcut to Run Ubuntu shell in Termux:


To create a shortcut for ubuntu shell you can just paste the below command once in your termux terminal and after restarting whenever you will type "ubuntu" in your termux shell your Ubuntu shell will be started immediately. You can also edit the green part in the command to whatever alias you want.


echo "alias ubuntu='cd && cd ubuntu-in-termux && ./startubuntu.sh'" >> /data/data/com.termux/files/usr/etc/bash.bashrc 


Install Neofetch in Ubuntu shell:


We all know that one of the most useful intro screen in termux is neofetch. And whenever I install any flavor of linux in my system I always first install neofetch in it to get the feel of the OS. To install anything in ubuntu you hav

e to use apt-get command. 


apt-get install neofetch


echo 'neofetch' >> /etc/bash.bashrc

No comments:

Post a Comment

Pages