Things To Do After Installing Termux (Advance)

After you install termux, you should do this optional action to support the termux work, such as installing the package and module most used, cloning the tools installer, etc.

The following are 7 things to do after installing termux.

  1. Changing termux repositories (If using the termux from playstore)
  2. Updating and upgrading termux repositories
  3. Installing packages and modules most used
  4. Cloning the tool installer
  5. Giving termux permission
  6. Adding extra keys button
  7. Changing the termux homepage

Changing Termux Repositories

The first action is changing termux repositories. But if you downloaded termux from f-droid, skip it. This action is only for those who downloaded termux from google playstore.

The termux from google playstore was not receiving updates since 2020, but you can still use it on your android with the termux repository updated.

Here’s how to change termux repositories to the latest.

1. Open the termux repository

Termux has three repositories: game repo, science repo, and main repo hosted on six different servers.

To open the termux repository, type the command below.

				
					termux-change-repo
				
			

2. Choose the repository to be updated

Main repo is termux repository containing packages and modules to support termux work. So, we have to choose it to be updated. But, to avoid errors when using termux in the future, we must select all repo.

To select the termux repo, tap the repo’s name on the screen until the star sign appears. Then click ok to move to the next step.

3. Activate the mirror server

By default, the termux repo points to its official repo hosted on Bintray (Now it has died). We have to change it to another server that is still active.

I tested all mirror repositories to find which one is still working, and I found three mirrors still active: a1btr, tsingh, and bsfu.

You can choose one of them to activate the mirror server by tapping the server name and clicking OK. Here I use the server hosted by A1btr.

After selecting the server, wait for the update process to complete.

If the result shows the notification “Run apt list -upgradable to see them,” the repository has changed to the latest.

Updating And Upgrading Termux Repositories

Before starting to use termux, we must update and upgrade termux repositories to get the newest packages and modules. If we have installed termux for the first time, we must do this action.

The goal is to make packages and modules in termux more compatible with programs that use the latest programming languages.

To update and upgrade termux repositories, enter the command:

				
					apt update && apt upgrade -y
				
			

Then termux will start updating and upgrading process. In the middle of the process, termux will stop several times for asking your action.

Tips:
Type Y and click enter in every process needing your action.

Installing Packages And Modules Most Used

Based on termux usage data, few users use termux for editing files, compiling and decompiling programs, and modifying android features. And most users termux operate termux to install and run a script or program.

Every script or program requires a specific package and module.

For example:

ABC script requires the package: python, OpenSSL, and figlet.
And the module: mechanize and bs4.

Then XYZ script requires the package: PHP, Ruby, and bash.
And the module: requests and tqdm.

*If we install and run a script, but termux doesn’t have the required package and module, it will cause an error.

To make termux can install and run all scripts without an error, we have to install all packages with pkg install <package name> and modules with pip install <module name>.

The following is one line command to install all packages and modules most used.

				
					pkg install python python2 php bash wget vim nano git figlet zip unzip tor toilet openssl curl make cmake && pip install mechanize requests bs4 tqdm six urllib3 colorama uncompyle6 
				
			

If you want to install the package individually, add pkg install before every package and run it.

For example, pkg install python (hit enter to run). After the process finishes, enter pkg install again before the package you want to install (pkg install git).

Cloning The Tool Installer

Tools installer is a program containing a list of termux scripts that users can install on termux. This program facilitates termux users to find tools without knowing where it’s stored.

To clone the tool installer, we must type git clone <tool link>. This process is the same as when installing a script on termux.

Here I will show you how to install one of the popular tool installers, Tool-X.

*Enter the command below one by one in order.

				
					pkg install git
git clone https://github.com/bookofmoon/Tool-X/
cd Tool-X
chmod +x install.aex
./install.aex
				
			

After entering the command above, termux will show a confirmation page “Do you want to install Tool-X?”. 

*Type Y for yes and N for no.

You must type Y and click enter. Then wait for the Tool-X installation complete.

If it has finished, type Tool-X and tap enter button to run it.

On Tool-X homepage, you can show all list of script by selecting first menu (show all tools). Then to install the script you want, type the numbers in the order of Tool-X menu.

For example:

You want to install wifite script that is in the 375th place. So, type 375 and tap enter to install wifite. After installing process finish, follow the instruction showing in the screen.

Giving Termux Permission

Termux only has one permission you can grant if you want to transfer data from Android to termux storage or vice versa. That permission is accessing android storage.

Sometimes we have a file in termux that we want to move to android storage. If termux has no access to android storage when we move a file from termux to Android or vice versa, it will cause a permission denied error.

To avoid that error, we have to give termux permission to access android storage by entering the command below.

				
					termux-setup-storage
				
			

If there is a pop-up, choose grant or allow.

After you run that command, check whether termux has permission by typing cd /sdcard && ls. If the result shows a list of folders and files from your android storage, it means termux has got the permit.

Adding Extra Keys Button

The extra key is a button that locates above the keyboard and has a function to facilitate users when entering termux commands.

Termux had an extra keys button, but it didn’t handy because of the improper button choice. Therefore we have to modify it to use it more efficiently.

The following is the extra keys button by termux.

And this is the modified extra keys button. 

Many buttons that we often use, isn’t it?

To add and modify the extra keys button termux, we have to edit the termux.properties in the .termux folder. 

Use command:

				
					cd .termux && rm termux.properties && nano termux.properties
				
			

Then copy the code below and paste it to the termux.properties file.

				
					extra-keys = [ \
 ['git clone','python','php'], \
 ['ls','-','/','UP','='], \
 ['CTRL','cd ','LEFT','DOWN','RIGHT'] \
]
				
			

Information:
You can change the word inside the sign ‘ ‘ with the termux command you use often. In addition, you can also delete the specific line of code to make it not appear on the termux screen.

If you want to use the extra keys button by termux, copy and paste the code below.

				
					extra-keys = [ \
 ['ESC','|','/','HOME','UP','END','PGUP','DEL'], \
 ['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN','BKSP'] \
]
				
			

Changing The Termux Homepage

By default, the termux homepage shows information such as welcome to termux, working with packages, and how to fix repository issues. That information is printed from motd file in ../usr/etc folder.

We can remove it all and change it with information about ourselves, the ASCII logo, or header text by figlet to make the termux interface more attractive.

Here’s the step to edit termux homepage.

  1. Find motd file with cd ../usr/etc.
  2. Delete motd file and make a new file with the same name (motd) with the command: rm motd && nano motd.
  3. Write or place whatever you want, and if it has finished, save it by tapping ctrl+c and choose y, then tap enter.

To add a header or ASCII text, you must place it manually.

Whatever you write on the motd file will be printed only, although it is a line of code.

What's Next?

If you have done all these actions, your termux becomes powerful because it has been set up. You can start a program or script you couldn’t run before because package or module not installed error.