This article will describe how to install a Linux system (command line interface) through the powerful Termux on a tablet/mobile device, and learn Linux command line and Linux practice. For example, install Ubuntu 22.04, CentOS, etc. I am using Matepad pro (Hongmeng 3.0), Android 7.0 or above is recommended for Android devices. (If you want to experience the Linux desktop, you need to perform two more steps at the end, but in view of the poor experience on tablet or mobile devices, it is recommended that you use a Linux virtual machine or physical machine)
1. Install two software Termux and Anlinux
1. First upload the link (apk package)
If possible (scientific surfing), it is recommended to use apkpure and F-Droid software to download
termux official website download
termux duniang link (extraction code: htys)
Anlinux Du Niang can't share
It doesn’t matter if you only install termux but not anlinux , go directly to the second step to execute the code, and install Ubuntu 22.04 and CentOS 7 as well (centos and kali commands are at the end)
2. Software introduction
(1).Termux
Termux is a terminal emulator application running on the Android operating system that provides a Linux terminal-like environment allowing users to run command-line based tools and applications on their devices . With Termux, users can access and manage files, use Linux tools, run scripts, build web servers, and more on their Android devices. In addition, users can also use Termux to compile code, run programs, connect to SSH, etc.
Termux provides an Android-based Linux environment, which is achieved by installing a Linux distribution. Specifically, Termux uses a Debian-based distribution on which it builds some of its own tools and libraries
Note: Similar iSH and Blink Shells are recommended for IOS or PadOS
It is worth mentioning that you can use the command line directly in Termux to operate (but not sudo and root, if necessary, you can find some tutorials), but you can install Ubuntu or CentOS in Termux (directly obtain root privileges), etc. system for a better experience
(2).AnLinux
By using AnLinux, users can run Linux distributions such as Ubuntu, Debian, Kali Linux, etc. on their Android devices, allowing them to use various command line tools and applications. The AnLinux project provides automation scripts that allow users to quickly and easily install and configure Linux distributions on Android devices. These scripts download and install the required packages and configure the operating environment of the Linux distribution
Anlinux provides scripts for installing various Linux distributions. This article has given the scripts required to install Ubuntu22.04 and explained them in detail for your understanding
2. Specific operation (take Ubuntu (recommended) as an example)
(1). Open AnLinux --> Dashboard --> Select --> Ubuntu --> OK
(If there is no AnLinux, please see the second step)
(2). Copy - paste to Termux and execute - wait for completion
If you don’t use the keyboard, press and hold the command on the termux page, then Paste
code show as below:
pkg install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Ubuntu/ubuntu.sh && bash ubuntu.sh
Code explanation:
pkg install wget openssl-tool proot -y
This command uses Termux's own
pkg
package manager to installwget
,openssl-tool
andproot
packages, which are all dependencies required to run Ubuntu in Termux.-y
option to automatically confirm all prompts during installation.
hash -r
This command clears the cache in the current terminal session so that newly installed packages can take effect immediately.
wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Ubuntu/ubuntu.sh
This command uses
wget
the command to download a script file named Ubuntu from GitHububuntu.sh
. This script file is used to install Ubuntu.
bash ubuntu.sh
This command uses
bash
the interpreter to run the script you just downloadedubuntu.sh
, which will create aAn Ubuntu environment.
(3). Use the following code to start Ubuntu
./start-ubuntu.sh
then see
root@localhost:~#
Indicates that you are already a root user
(4).Basic configuration
- Create user - same as normal Ubuntu, see Ubuntu Tutorial
You can directly use this system as a complete Linux and perform various configurations, but please note that it can only operate the command line and cannot open a software page or picture. If you really want to experience the Ubuntu desktop on a tablet or mobile phone, you need to download the VNC remote connection software, and you can find many tutorials
2. Enter ` exit` - exit Ubuntu and return to termux
add centos
pkg install wget openssl-tool proot tar -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/CentOS/centos.sh && bash centos.sh
Start with ` ./start- centos.sh`
add kali
pkg install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Kali/kali.sh && bash kali.sh
Start with ` ./start-kali.sh`