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.
Termux (com.termux) can be installed from F-Droid.
WARNING: If you installed termux from Google Play or a very old version, then you will receive package command errors. Google Play builds are deprecated and no longer supported. It is highly recommended that you update to termux-app v0.118.0 or higher as soon as possible for various bug fixes, including a critical world-readable vulnerability reported at https://termux.github.io/general/2022/02/15/termux-apps-vulnerability-disclosures.html. It is recommended that you shift to F-Droid or GitHub releases.
Refer to Android-Non-Root for more information.
- Sufficient storage (calculated on Termux 0.118.3, excluding cleanable caches):
- Approximately 0.2 GB for the Termux app itself.
- Approximately 6.4 GB in total for the minimal configuration with
XFCE=0,ANDROID=0, andTERMUX='' UBUNTU='' UBUNTUINSTALL=0 DEBIAN='' DEBIANINSTALL=0 UBUNTUBOX='' UBUNTUBOXINSTALL=0 DEBIANBOX='' DEBIANBOXINSTALL=0 - Approximately 0.4 GB more for
XFCE=1. - Approximately 2.6 GB more for
ANDROID=1. - Approximately 0.1 GB more for a nonempty
TERMUX. - Approximately 0.3 GB more for a nonempty
UBUNTU. - Approximately 0.2 GB more for a nonempty
DEBIAN. - Approximately 29.7 GB more for
UBUNTUINSTALL=1. - Approximately 29.7 GB more for
DEBIANINSTALL=1. - Approximately 37.8 GB in total for the default configuration with
XFCE=1,ANDROID=1, andTERMUX='termux' UBUNTU='ubuntu' UBUNTUINSTALL=1 DEBIAN='debian' DEBIANINSTALL=0 UBUNTUBOX='' UBUNTUBOXINSTALL=0 DEBIANBOX='' DEBIANBOXINSTALL=0
- 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 Entererror 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: https://willie169.github.io/Android-Non-Root/#process-completed-signal-9---press-enter-error for the fixes.
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.
- Run
gh auth login --scopes repo,read:org,admin:org,workflow,gist,notifications,delete_repo,write:packages,read:packagesto login to GitHub. - Run
git config --global user.name [your_name] && git config --global user.email [your_email]to config git.
The variables below refer to the variables set in the beginning of termux-setup.sh.
- Termux properties adjustments: Enables external app access in
termux.properties. - Shortcut configuration: Copies shortcuts from
DOTshortcutsinto~/.shortcutsfolder (for Termux:Widget) andDocuments.sh,Download.sh,Storage.shinto home directory~. See Shortcuts section for more information. - Bashrc configuration: Copies
~/.bashrc.dand~/.bashrcfrom my bashrc repo (can be updated withupdate_bashrc). - Termux packages installation: Installs Termux packages set in
$PKG. The default ones include tools for C, C++, COBOL, Python3, Java21, Node.js, Rust, Go, Ruby, Perl, GitHub CLI, GitLab CLI, OpenSSL, OpenSSH, JQ, Ghostscript, FFMPEG, Maven, Zsh, PRoot, RARLAB UnRAR, Icarus Verilog, Ngspice, jpegoptim, optipng, libheif, Inkscape, XMLStarlet, GTKWave, Matplotlib, Ninja, SciPy, SQLite 3,PostgreSQL 18, GNU Go, and more. - XFCE desktop environment: Installs TigerVNC server and XFCE desktop environment, and configures
vncserverto launch XFCE4 desktop environment if notXFCE=0. - Android Build Environment Setup: Setup Android apps build environment if not
ANDROID=0using script modified from my termux-android-sdk-ndk repo. Refer to it for more information. - Vim configuration: Install my modified version of vimrc by Amir Salihefendic (amix) for both Vim and Neovim if not
VIMRC=0. - NPM packages: Installs NPM packages set in
$NPMlocally in~and NPM packages set in$NPMGglobally. The default$NPMisjsdom markdown-toc marked marked-gfm-heading-id node-html-markdown showdown. The default$NPMGishttp-server @openai/codex. - Pip packages: Installs pip packages set in
PIP. The default one isjupyter matplotlib meson numpy pandas plotly pydub requests selenium setuptools sympy. - Go packages: Installs Go packages set in
GO. The default one is empty. - JARs: Installs ANTLR 4 (JAR in
/usr/local/java) if notANTLR=0and PlantUML (JAR in/usr/local/java) if notPLANTUML=0. - Proot-distro Termux environment: Installs an Termux proot-distro environment with alias
$TERMUXand add boot scriptproot-$TERMUX.shinto home directory~and~/.shortcutsfolder (for Termux:Widget) if$TERMUXis not empty string. - Proot-distro Ubuntu environment: Installs an Ubuntu ARM64 proot-distro environment with alias
$UBUNTUand add boot scriptproot-$UBUNTU.shinto home directory~and~/.shortcutsfolder (for Termux:Widget) if$UBUNTUis not empty string, and runsubuntu-debian.shin it if$UBUNTUis not empty string and$UBUNTUINSTALLis not0. See Invoked VM Setup Scripts section for more information.ollama pull llama3.2, - Proot-distro Debian environment: Installs Debian ARM64 proot-distro environment with alias
$DEBIANand add boot scriptproot-$DEBIAN.shinto home directory~and~/.shortcutsfolder (for Termux:Widget) if$DEBIANis not empty string, and runsubuntu-debian.shin it if$DEBIANis not empty string and$DEBIANINSTALLis not0. See Invoked VM Setup Scripts section for more information. - Proot-distro Ubuntu environment with Box64, Wine64, and Winetricks (not invoked by default): Installs Ubuntu ARM64 proot-distro environment with alias
$UBUNTUBOXand add boot scriptproot-$UBUNTUBOX.shinto home directory~and~/.shortcutsfolder (for Termux:Widget) if$UBUNTUBOXis not empty string, and runsbox64-wine64-winetricks.sh(no longer actively maintained) in it if$UBUNTUBOXis not empty string and$UBUNTUBOXINSTALLis not0. See Invoked VM Setup Scripts section for more information. - Proot-distro Debian environment with Box64, Wine64, and Winetricks (not invoked by default): Installs Debian ARM64 proot-distro environment with alias
$DEBIANBOXand add boot scriptproot-$DEBIANBOX.shinto home directory~and~/.shortcutsfolder (for Termux:Widget) if$DEBIANBOXis not empty string, and runsbox64-wine64-winetricks.sh(no longer actively maintained) in it if$DEBIANBOXis not empty string and$DEBIANBOXINSTALLis not0. See Invoked VM Setup Scripts section for more information.
These scripts will be invoked by Termux Setup if corresponding configuration is set.
ubuntu-debian.sh: Configures PulseAudio and installs development tools, runtime environments, and utilities for C, C++, COBOL, Python3, Java 21, Node.js 24 (via NVM), Yarn, Rust, Go, Ruby, Perl, Fortran, Aptitude, GitHub CLI, OpenSSL, OpenSSH, JQ, Ghostscript, GHC Filesystem, FFMPEG, Pandoc, TeX Live (via regular installation instead of APT, for unrestrictedtlmgrand updates), Maven, Zsh, iproute2, net-tools, aria2, nvm, pnpm, Yarn, NPM packagesjsdom markdown-toc marked marked-gfm-heading-id node-html-markdown showdownlocally in~andhttp-server @openai/codexglobally, GNU Chess, GNU Go, Aider, Ollama withllama3.2:1bpulled, Open Code, Bun, Miniforge, pipx, Poetry, uv, XITS fonts, Noto CJK fonts, RARLAB UnRAR, Icarus Verilog, Verilator, Ngspice, jpegoptim, optipng, libheif, Inkscape, XMLStarlet, GTKWave, SDL2, SDL2 BGI, ANTLR 4 (JAR in/usr/local/java), Firefox, TigerVNC server, XFCE desktop environment with fix for stuckelementary-xfce-icon-theme(see my fix-elementary-xfce-icon-theme repo for more information), .NET SDK 10, ASP.NET Core Runtime 10, PlantUML (JAR in/usr/local/java), SQLite 3, PostgreSQL 17, KataGo (~/KataGo/cpp/katagoand can be run withkatago) and KataGo networkkata1-b6c96-s175395328-d26788732(in~/katago-networks, other networks can be downloaded from https://katagotraining.org/networks), LizzieYzy (can be launched by runninglizzieyzyor with desktop entry~/.local/share/applications/lizzieyzy.desktopor~/desktop/lizzieyzy.desktop, runtime directory~/.lizzieyzy, KataGo networkkata1-b6c96-s175395328-d26788732configured as default engine and estimate engine in~/.lizzieyzy/config.txt, which can be updated by runningupdate_lizzieyzy_config), Fairy-Stockfish (~/Fairy-Stockfish/src/stockfishand can be run withstockfish), Cute Chess (GUI at~/cutechess/build/cutechessand can be launched by runningcutechessor with desktop entry~/.local/share/applications/cutechess.desktopor~/desktop/cutechess.desktop, CLI at~/cutechess/build/cutechess-cliand can be run withcutechess-cli, Fairy-Stockfish configured as engine in~/.config/cutechess/engines.json, which can be updated by runningupdate_cutechess_config), Sylvan (GUI at~/Sylvan/projects/gui/sylvanand can be launched by runningsylvanor with desktop entry~/.local/share/applications/sylvan.desktopor~/desktop/sylvan.desktop, CLI at~/Sylvan/projects/cli/sylvan-cliand can be run withsylvan-cli, Fairy-Stockfish configured as engine in~/.config/EterCyber/engines.json, which can be updated by runningupdate_sylvan_config), my modified version of vimrc by Amir Salihefendic (amix) for both Vim and Neovim (can be updated by runningupdate_vimrc), my LaTeX packagephysics-patchand my LaTeX templateLaTeX-ToolKit(can be updated withupdate_latex), and more, and copies~/.bashrc.dand~/.bashrcfrom my bashrc repo (can be updated by runningupdate_bashrc), on Ubuntu or Debian ARM64 Proot environment.box64-wine64-winetricks.sh: Installsbox64,wine64, andwinetricksfor running x86_64 Linux and Windows applications on Debian derivatives ARM64. (No longer actively maintained.)
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. (No longer actively maintained.)nethunter.sh: Boots the Kali Nethunter proot-distro instance with the aliaskali-defaultas userkaliwithisolatedandfix-low-portsoptions.
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 bzip2 backup with the highest compression level of/data/data/com.termux/files/homeand/data/data/com.termux/files/usrsplit into 4000MB parts.
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. (No longer actively maintained.)xmrig-install.sh: Clones and compiles xmrig, an open source Monero (XMR) miner, on Termux.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, e.g.,KBDEXKMTEfor everything andKBDEXKMTDfor default. 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.
This repository is licensed under GNU General Public License General Public License, see LICENSE.md for details.