This repository contains Shell scripts for Termux, a terminal emulator for Android. These scripts include setup automation, shortcuts, installations and configurations of development tools and emulation environments such as proot, proot-distro, QEMU system emulation, and box64, and more.
My tutorials for Termux, some of my scripts in this repository, and other related stuff are in Android-Non-Root, which includes tutorials for a range of powerful, open-source tools such as Termux, F-Droid, Shizuku, Tor, TrackerControl, InviZible Pro, QEMU, Tailscale, OpenSSH, and PipePipe to enhance Android device’s functionality, security, privacy, and customization without the need for root access.
- [Termux Setup (
termux-setup.sh)](#termux-setup-termux-setupshtermux-setupsh) - Shortcuts
- Additional Scripts
- My Related Repositories
- TODO
- License
- References
Termux Setup (termux-setup.sh)
- Sufficient storage:
- Approximately 18.5 GB (outdated) for default configuration, i.e.,
DEBIAN='debian' DEBIANINSTALL=1 UBUNTU='ubuntu' UBUNTUINSTALL=0 DEBIANBOX='' DEBIANBOXINSTALL=0 - Approximately - GB (haven't been counted) for configuration of:
DEBIAN='debian' DEBIANINSTALL=1 UBUNTU='ubuntu' UBUNTUINSTALL=1 DEBIANBOX='' DEBIANBOXINSTALL=0 - Approximately 30.1 GB (outdated) for configuration of:
DEBIAN='debian' DEBIANINSTALL=1 UBUNTU='ubuntu' UBUNTUINSTALL=1 DEBIANBOX='debianbox' DEBIANBOXINSTALL=1
- Approximately 18.5 GB (outdated) for default configuration, i.e.,
- Sufficient power supply.
- Stable internet connection.
- It is recommended to turn off the battery optimization for Termux.
- It is recommended to hold wakelock while running these scripts. You can do so by opening Termux, pulling down the notification bar, and then tapping **Acquire wakelock** on the notification of Termux.
- It is recommended to prevent the `Process completed (signal 9) - press Enter` error in advance. You may encounter it when using Termux, especially when running VMs. To prevent it from occuring, please read tutorial about it in my **Android Non Root**: for the fixes.
- It is recommended to run
termux-change-repoand choose a mirror close to your geographic location. termux-setup-storage pkg update && pkg install git -y cd ~ && git clone https://github.com/Willie169/termux-sh.git- Optionally edit the variables in the beginning of
~/termux-sh/termux-setup.sh(nanofor example). In VM names variables,(space) will be replaced with_, names that are not allowed will be added a suffix1:pkg install nano nano ~/termux-sh/termux-setup.sh - Run the setup script:
bash ~/termux-sh/termux-setup.sh - Follow the prompts until it exits automatically.
The variables below refer to the variables set in the beginning of termux-setup.sh.
- Termux packages installation: Installs Termux packages set in
$PKG. The default ones include tools for C, C++, COBOL, Python3, Java17, Java21, Node.js, Rust, Go, Ruby, Perl, GitHub CLI, GitLab CLI, OpenSSL, OpenSSH, JQ, Ghostscript, FFMPEG, Maven, Zsh, Termux-X11, TigerVNC, XFCE4, PRoot, RARLAB UnRAR, Icarus Verilog, jpegoptim, optipng, Matplotlib, Ninja, SciPy, and more. - Shortcut configuration: Copies shortcuts (including all VM-boosting shortcuts even if those VMs are not configured to be installed) from
DOTshortcutsinto.shortcuts(for Termux:Widget) and the home directory (~) and renames~/bashrc.shto~/.bashrc. - Vim configuration: Install vimrc by Amir Salihefendic (amix) with my customization for both Vim and Neovim if not
VIMRC=0. See Vimrc section for Vim and Nvim usage. - Termux properties adjustments: Enables external app access in
termux.properties. - Termux PRoot environment: Installs termux-proot by Yonle, a Termux PRoot environment, with
proot-termux.sh, if notPROOTTERMUX=0. - Node.js tools: Installs nvm, pnpm, and Yarn, and installs NPM packages set in
$NPMglobally. - Python packages: Installs pip packages set in
PIPINSTALLin it ifPIPINSTALLis not empty. The default ones arejupyter meson numpy pandas pipx pydub selenium setuptools sympy. - Fabric installation: Installs Go package fabric, an open-source modular framework for augmenting humans using Al using a crowdsourced set of Al prompts.
- Proot-distro Debian Bookworm environment with development tools: Installs Debian ARM64 proot-distro environment with alias
$DEBIANif$DEBIANis not empty string, and runsdebian.shin it if$DEBIANis not empty string and$DEBIANINSTALLis not0. See Invoked VM Setup Scripts section the script. - Proot-distro Ubuntu environment with development tools: Installs an Ubuntu ARM64 proot-distro environment with alias
$UBUNTUif$UBUNTUis not empty string, and runsubuntu.shin it if$UBUNTUis not empty string and$UBUNTUINSTALLis not0. See Invoked VM Setup Scripts section the script. - Proot-distro Debian Bookworm environment with Box64, Wine64, and Winetricks: Installs Debian ARM64 proot-distro environment with alias
$DEBIANBOXif$DEBIANBOXis not empty string, and runsbox64-wine64-winetricks.shin it if$DEBIANBOXis not empty string and$DEBIANBOXINSTALLis not0. See Invoked VM Setup Scripts section the script.
These scripts will be invoked by Termux Setup if corresponding configuration is set.
debian.sh: Configures PulseAudio and installs development tools, runtime environments, and utilities for C, C++, COBOL, Python3, Java (default-jdk), Node.js, Yarn, Rust, Go, Ruby, Perl, Aptitude, GitHub CLI, OpenSSL, OpenSSH, FFMPEG, Pandoc, TeX Live, iproute2, net-tools, nvm, pnpm, Yarn, Node.js packages, Python3 packages in~/.env, pipx, Poetry, uv, XITS fonts, Noto CJK fonts, UnRAR-free, Icarus Verilog, Verilator, jpegoptim, optipng, SDL2, SDL2 BGI, TigerVNC server, XFCE desktop environment, vimrc by Amir Salihefendic (amix) with my customization for both Vim and Neovim, my LaTeX packagephysics-patch, my LaTeX templateLaTeX-ToolKit, and more, and adds custom~/.bashrcon Debian ARM64. Invoked for the Debian ARM64 proot-distro environment with alias$DEBIAN. See Vimrc section for Vim and Nvim usage.ubuntu.sh: Configures PulseAudio and installs development tools, runtime environments, and utilities for C, C++, COBOL, Python3, Java (default-jdk), Node.js, Yarn, Rust, Go, Ruby, Perl, Aptitude, GitHub CLI, OpenSSL, OpenSSH, FFMPEG, Pandoc, TeX Live, iproute2, net-tools, nvm, pnpm, Yarn, Node.js packages, Python3 packages in~/.env, pipx, Poetry, uv, XITS fonts, Noto CJK fonts, RARLAB UnRAR, Icarus Verilog, Verilator, jpegoptim, optipng, SDL2, SDL2 BGI, TigerVNC server, XFCE desktop environment, vimrc by Amir Salihefendic (amix) with my customization for both Vim and Neovim, my LaTeX packagephysics-patch, my LaTeX templateLaTeX-ToolKit, and more, and adds custom~/.bashrcon Ubuntu ARM64. Invoked for the Ubuntu ARM64 proot-distro environment with alias$UBUNTU. See Vimrc section for Vim and Nvim usage.box64-wine64-winetricks.sh: Installsbox64,wine64, andwinetricksfor running x86_64 Linux and Windows applications on an ARM64 Linux instance. Invoked for the Debian ARM64 proot-distro instance with alias$DEBIANBOX.
Shortcuts are located in DOTshortcuts. Some of them are intended for tools that is not installed or configured in the Termux Setup, such as QEMU. Some related scripts are in Additional Scripts.
qemu-alpine-aarch64.sh,qemu-alpine-aarch64-vnc.sh,qemu-alpine-x86_64.sh,qemu-alpine-x86_64-vnc.sh,qemu-debian-aarch64.sh,qemu-debian-aarch64-vnc.sh,qemu-alpine-amd64.sh,qemu-debian-amd64-vnc.sh,qemu-bliss-vnc.sh: Boot respective QEMU system emulation VMs with-netdev user,id=n1,dns=8.8.8.8,hostfwd=tcp::2222-:22 -device virtio-net,netdev=n1option, where files with-vncin their names start VNC server at the host'slocalhost:0and others are-nographic. Those VMs can be installed withqemu-alpine-aarch64-install.sh,qemu-alpine-x86_64-install.sh,qemu-debian-arm64-install.sh,qemu-debian-amd64-install.sh, andqemu-bliss-install.shrespectively. See Additional Scripts for details.nethunter.sh: Boots the Kali Nethunter proot-distro instance with the aliaskali-defaultas userkaliwithisolatedandfix-low-portsoptions.proot-termux.sh: Boot the Termux proot.
bashrc.sh: A customized.bashrcfor Termux with pre-defined aliases, functions, environment variables for development tools and human usages, PulseAudio setup, etc.vimrc: A customized.vimrc.gitPull.sh:git pullall repositories in~/gh.code.sh,download.sh:cd /storage/emulated/0/Documents/codeandcd /storage/emulated/0/Downloadrespectively.xmrig.sh: Mines XMR to the repository owner's wallet,48j6iQDeCSDeH46gw4dPJnMsa6TQzPa6WJaYbBS9JJucKqg9Mkt5EDe9nSkES3b8u7V6XJfL8neAPAtbEpmV2f4XC7bdbkv, using xmrig, which is not installed in the Termux Setup and can be installed withxmrig-install.sh. Change the wallet address and other configurations if you need.shizuku.sh:cd shizukuandsh rish. This is a shortcuts for Shizuku, which is not configured in the scripts in this repository. Please refer to the section of my tutorial "Android-Non-Root" about it for more information.termux-backup-bz.sh: Creates a compressed backup with the highest compression level of BZIP2 of the/data/data/com.termux/files/homeand/data/data/com.termux/files/usr, then splits the resulting archive into parts, each 4000MB in size.
These scripts are not invoked by Termux Setup. Run it separately if you need it.
qemu-alpine-aarch64-install.sh,qemu-alpine-x86_64-install.sh,qemu-debian-arm64-install.sh,qemu-debian-amd64-install.sh,qemu-bliss-install.sh: Setup and boot the respective QEMU system emulation VMs with-netdev user,id=n1,dns=8.8.8.8,hostfwd=tcp::2222-:22 -device virtio-net,netdev=n1option, where the Alpine VMs are created from Virt 3.21.0 ISO images and the Debian VMs are pre-created Bookworm QCOW2 images.qemu-bliss-install.shstarts VNC server at the host'slocalhost:0and others are-nographic. Remember tosetup-alpinein Alpine VMs and resize disk in Debian VMs. Bliss OS is an Android-based open source OS for x86_64 architecture that incorporates many optimizations, features, and that supports many more devices.alpine-docker.sh: Installs Docker on an Alpine machine and run hello-world.debian-waydroid.sh: Installs Waydroid on Debian derivatives such as the QEMU Debian VMs. Waydroid is a container-based approach to boot a full Android system in a Linux namespace on a GNU/Linux-based platform.xmrig-install.sh: Clones and compiles xmrig, an open source Monero (XMR) miner.proot-install-nethunter.sh: Installs Kali Nethunter ARM64 proot-distro environment from https://github.com/sagar040/proot-distro-nethunter. Follow the screen guide and enter wanted Build ID to install. For example,KBDEXKMTEfor everything, which occupies about 34GB, andKBDEXKMTDfor default, which occupies about 13GB. Boot it with<build id> [USER]orproot-distro login <build id> [USER]. Open GUI after logged in withsudo kgui. Please go to https://github.com/sagar040/proot-distro-nethunter for more information.debian-buster-xfce-mod.sh: Modified version ofAndronix's debian-xfce.sh, which installs and configures XFCE desktop environment and VNC server for Debian Buster ARM64 PRoot environment.proot-install-buster-cli.sh: Installs Andronix Debian Buster ARM64 PRoot CLI-only environment in~/$BUSTERCLIif$BUSTERCLIis not empty string usingAndronix's debian.sh. Configure theBUSTERCLIvariable in the file to change the directory.proot-install-buster-xfce.sh: Installs Andronix Debian Buster ARM64 PRoot environment with XFCE desktop environment and VNC server in~/$BUSTERXFCEif$BUSTERXFCEis not empty string usingdebian-buster-xfce-mod.sh.
- Edit your customizations in
~/vim_runtime/my_configs.vim. - Setup GitHub Copilot with
:Copilot setup. install-tools-first.shdisable GitHub Copilot by default. To enable it, removelet g:copilot_enabled = v:falsefrom~/vim_runtime/my_configs.vim. Run:let g:copilot_enabled = v:falseto disable GitHub Copilot temporarily. Run:let g:copilot_enabled = v:trueto enable GitHub Copilot temporarily. Addlet g:copilot_enabled = v:falseto~/vim_runtime/my_configs.vimto disable GitHub Copilot globally.- See vimrc by Amir Salihefendic (amix) for more information.
- Make the configuration in termux-setup.sh more customizable.
- Modularize scripts for flexibility and reusability.
- Expand VMs and development tools support.
This repository is licensed under GNU General Public License General Public License, see LICENSE.md for details.
- https://alpinelinux.org.
- https://andronix.app.
- https://blissos.org.
- https://github.com/amix/vimrc.
- https://github.com/AndronixApp/AndronixOrigin.
- https://github.com/cyberkernelofficial/docker-in-termux.
- https://github.com/diogok/termux-qemu-alpine-docker.
- https://github.com/hugomd/parrot.live.
- https://github.com/notofonts/noto-cjk.
- https://github.com/sagar040/proot-distro-nethunter.
- https://github.com/termux/proot-distro.
- https://github.com/termux/termux-app.
- https://github.com/termux/termux-widget.
- https://github.com/willie169/Android-Non-Root.
- https://github.com/Willie169/LaTeX-ToolKit.
- https://github.com/zanjie1999/windows-fonts.
- https://ivonblog.com.
- https://ryanfortner.github.io.
- https://wiki.termux.com.
- https://willie169.github.io.
- https://www.debian.org.
- https://www.docker.com.
- https://www.qemu.org.
- https://waydro.id.