This repository contains Shell scripts for Termux including setup automation, shortcuts, and installations and configurations of development tools and emulation environments.
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.
- Full features are supported on arm64-v8a architecture, but only limited features are supported on other architectures.
- Sufficient storage: (calculated using GitHub Action, typically a bit less than that on a real device)
- Previous rows remain default with
: approximately 14.55 GB.
TERMUX='termux' UBUNTU='ubuntu' UBUNTUINSTALL=0 DEBIAN='debian' DEBIANINSTALL=0 UBUNTUINSTALL=1orDEBIANINSTALL=1: approximately 27.77 GB.
- Previous rows remain default with
- 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 disable phantom process killer to prevent
Process completed (signal 9) - press Entererror from occuring when using Termux in advance by executingIf you have setup Shizuku withdevice_config set_sync_disabled_for_tests persistent device_config put activity_manager max_phantom_processes 214748364 settings put global settings_enable_monitor_phantom_procs falserishavailable in Termux to access interactive ADB shell, you can simply rundisable-phantom-process-killer-rish.shin this repo. If you have ADB connected withadb shellavailable, you can simply rundisable-phantom-process-killer-adb.shin this repo. Otherwise, refer to my guide about it in my Android Non Root repo or Android Non Root site.
- It is suggested to run
termux-change-repoand select repo(s) closer to your geographical location for faster download. 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(e.g.pkg install nano -y && nano ~/termux-sh/termux-setup.sh,pkg install vim -y && vim ~/termux-sh/termux-setup.sh). In proot names variables,(space) will be replaced with_, names that are not allowed will be added a suffix1. - 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 properties adjustments: Enables external app access and adjusts extra keys to my configuration designed for swipe gesture navigation, Vim/Neovim, and Markdown users in
termux.properties. Extra keys may need relaunching Termux to take effect. - JetBrainsMono Nerd Font: Download and change terminal font to JetBrainsMono Nerd Font.
- Shortcut configuration: Copies shortcuts from
DOTshortcutsinto~/.shortcutsfolder (for Termux:Widget) andDocuments.sh,Download.sh,Scripts.sh,Storage.sh,proot-termux.sh,proot-ubuntu.sh,proot-debian.shinto home directory~. See Shortcuts section for more information. - Bashrc configuration: Copies
~/.bashrc.dand~/.bashrcfrom my bashrc repo (can be updated by runningupdate_bashrc. Put your overrides in~/.bashrc.overrides. Tools and configurations installed by this script that is not managed by a package manager can be updated by runningupdate_tools. Tools installed by this script that is managed by a package managers can be updated by runningupdate_pm. Configurations installed by these scripts can be updated withupdate_config. Allupdate_*functions can be run by runningupdate_all.).proot-distro loginandrunwith my bindings used inproot-ubuntu.shetc. are defined as functionspdlandpdr, e.g.,pdl ubuntuandpdr ubuntu bash -c 'echo a'. - PulseAudio installation startup: Installs PulseAudio and starts it automatically in
~/.bashrc. - VirGL server installation and startup: Installs VirGL server and starts it automatically in
~/.bashrcaccording to my termux-x11-virgl-gpu-acceleration repo with variables exported in~/.bashrc. - Termux packages installation: Installs Termux packages set in
$PKG. Note that you need to download and install APK from https://github.com/termux/termux-x11 release to use Termux:X11. - img2pdf: Installs img2pdf if not
$IMG2PDF=0. - Git LFS: Installs Git LFS if not
$GITLFS=0. - git-delta: Installs git-delta and configures git to use it if not
$GITDELTA=0. - yt-dlp: Installs yt-dlp if not
$YTDLP=0. - XFCE desktop environment: Installs XFCE desktop environment, which can be started with Termux:X11 by running
termux-x11 :0 -xstartup "dbus-launch --exit-with-session xfce4-session", where0can be replaced with other numbers, which has been defined as a functionxxfcewith an optional argument for display (e.g.,:0). - Android Build Environment Setup: Runs install script from my termux-android-sdk-ndk repo with
platform-toolsinstalled, if notANDROID=0. Refer to it for more information. - Vim configuration: Installs Vim configuration from my vim-config repo (can be updated by running
update_vim_config), if not$VIM=0. - Neovim configuration: Installs Neovim configuration and required and recommended external applications from my nvim-config repo (You can do a configuration update by running
update_nvim_configand a full update by runningupdate_nvim_config_full). - rclone-extra: Installs rclone-extra, an unofficial fork of rclone, with additional enhancements such as Alist, Alist, iCloud Photos, Teldrive and Terabox support, if not
$RCLONEEXTRA=0. - mozlz4: Installs mozlz4 if not
$MOZLZ4=0. - Phice: Installs Phice, a lightweight privacy-friendly alternative front-end for Facebook, if not
$PHICE=0. It can be started by runningcd ~/phice && uv run gunicorn -b 127.0.0.1:<port> -w 4 "app:app"orphice [port](defined in my bashrc, and if port is not specified,5001is used) and accessed onlocalhost:<port>. - CyberChef: Installs CyberChef, a web app for encryption, encoding, compression and data analysis, if not
$CYBERCHEF=0. It can be started by optionally editing config in$PREFIX/var/lib/proot-distro/containers/cyberchef/rootfs/etc/nginx/conf.d/default.confand runningproot-distro run cyberchef, or runningcyberchef [port](defined in my bashrc, and if port is not specified,8081is used) and accessed onlocalhost:<port>. - Stirling PDF: Installs Stirling PDF, a powerful, open-source PDF editing platform, with English, Chinese - Simplified, Chinese - Simplified (vertical), Chinese - Traditional, and Chinese - Traditional (vertical) Tesseract OCR, if not
$STIRLINGPDF=0. It can be started by optionally editing config in$PREFIX/var/lib/proot-distro/containers/stirling-pdf/rootfs/configs/custom_settings.ymland runningproot-distro run stirling-pdf -e SECURITY_ENABLELOGIN=false -e LANGS=en_GB, or runningstirlingpdf [port](defined in my bashrc, and if port is not specified,9000is used) and accessed onlocalhost:<port>. It's normal that startup needs a while. - npm packages: Installs npm packages set in
$NPMGALLOWglobally with allowing scripts configured and npm packages set in$NPMGIGNOREglobally with scripts ignored. - pip packages: Installs pip packages set in
$PIP. - uv packages: Installs uv tools set in
$UV. - Apktool: Installs Apktool in
/$PREFIX/local/binif not$APKTOOL=0. - EFF Large Wordlist for Passphrases: Downloads EFF Large Wordlist for Passphrases in
~/.eff_large_wordlist.txt. - Proot-distro Termux environment: Installs an Termux proot-distro environment with alias
$TERMUX, which can be booted using scriptproot-termux.shin home directory~and~/.shortcutsfolder (for Termux:Widget), if$TERMUXis set as a nonempty string. - Proot-distro Ubuntu environment: Installs an Ubuntu ARM64 proot-distro environment with alias
$UBUNTUif$UBUNTUis set as a nonempty string, and runsubuntu-debian.shin it if$UBUNTUis set as a nonempty string, machine is of AArch64 (aka ARM64) architecture, and$UBUNTUINSTALLis not0. See Invoked VM Setup Scripts section for more information. - Proot-distro Debian environment: Installs Debian ARM64 proot-distro environment with alias
$DEBIANif$DEBIANis set as a nonempty string, and runsubuntu-debian.shin it if$DEBIANis set as a nonempty string, machine is of AArch64 (aka ARM64) architecture, and$DEBIANINSTALLis not0(less recommended than running it in Ubuntu since some tools are not supported and some tools are of older versions than in Ubuntu). 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(Only Ubuntu >= 24.04 and Debian >= 13 is supported. Running in Ubuntu is more recommended than in Debian since in Debian, some tools are not supported and some tools are of older versions.): Configures PulseAudio and VirGL (according to my termux-x11-virgl-gpu-acceleration repo and with variables exported in~/.bashrc) and installs development tools, runtime environments, and utilities for C, C++, Python3, Java 21, Rust, Go, Perl, LuaJIT, Aptitude, trash-cli, Git LFS, git-sizer, GitHub CLI, GitLab CLI, GVim, OpenSSL, OpenSSH, JQ, FFMPEG, Pandoc, TeX Live (via regular installation instead of APT for unrestrictedtlmgrand updates, can be updated withupdate_texlive), Maven, Zsh, XFCE desktop environment, checkinstall, iproute2, net-tools, Nmap, Node.js LTS (via NVM), npm, Yarn, Deno, http-server, Prettier, yt-dlp, Lazygit, Homebrew, Glow, bat, fd, ncdu, dust, fzf, Delta, ripgrep (rg), Yazi, zoxide, Miniforge, uv, autopep8, gallery-dl, procs, tldr, xmljson, JADX, Apktool, broot, bottom (btm), hyperfine, lsd, Qalculate! CLI (qalc), 2048, Cargo B(inary)Install (cargo-binstall), StyLua, gh2md, img2pdf, English, Chinese - Simplified, Chinese - Simplified (vertical), Chinese - Traditional, and Chinese - Traditional (vertical) Tesseract OCR, OCRmyPDF, LibreTranslate, Jupyter Notebook, JupyterLab, Jupytext, Meson, pylatexenc, RARLAB UnRAR, Verilator, Ngspice, jpegoptim, optipng, exiftool, libjxl, libheif, LibWebP, ImageMagick, Inkscape, Poppler, qpdf, PDFtk, Ghostscript, Bookletimposer, Audacity, w3m, XMLStarlet, GTKWave, Octave, XFCE desktop environment (can be started with Termux:X11 by runningtermux-x11 :0 &, logging into Proot-distro with--shared-tmpoption, and runningexport DISPLAY=:0andxfceinside, where0can be replaced with other numbers), fix for stuckelementary-xfce-icon-themefrom my fix-elementary-xfce-icon-theme repo, PlantUML, SQLite 3, yosys – Yosys Open SYnthesis Suite, mpv, iotop-c, netcat, NetHogs, net-tools, iftop, 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~/.local/share/lizzieyzy. KataGo networkkata1-b6c96-s175395328-d26788732configured as default engine and estimate engine in~/.local/share/lizzieyzy/config.txt.~/.local/share/lizzieyzy/config.txtcan be updated by runningupdate_lizzieyzy_config.), Fairy-Stockfish (can be run withstockfish), Cute Chess (GUI can be launched by runningcutechessor with desktop entry~/.local/share/applications/cutechess.desktopor~/desktop/cutechess.desktop, CLI can be run withcutechess-cli. Fairy-Stockfish configured as engine in~/.config/cutechess/engines.json.~/.config/cutechess/engines.jsoncan 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.~/.config/EterCyber/engines.jsoncan be updated by runningupdate_sylvan_config.), mozlz4, Noto Fonts (set as default font for system ui), Noto CJK Fonts (set as fallback font for system ui), Noto Color Emoji (set as fallback font for system ui), 全字庫正楷體 TW-Kai (set as fallback font for 標楷體 DFKai-SB), 全字庫正宋體 TW-Sung (set as fallback font for 細明體 MingLiu and 新細明體 PMingLiu), 文泉驛正黑 WenQuanYi Zen Hei (set as fallback font for 微軟正黑體 Microsoft JhengHei), my LaTeX packagephysics-patch(in~/texmf/tex/latex/physics-patch, checked outdevbranch, and can be updated withupdate_latex), my LaTeX templateLaTeX-ToolKit(in/usr/share/LaTeX-ToolKit/template.texand can be updated withupdate_latex), Vim configuration from my vim-config repo (can be updated by runningupdate_vim_config), Neovim configuration and required and recommended external applications from my nvim-config repo (You can do a configuration update by runningupdate_nvim_configand a full update by runningupdate_nvim_config_full), downloads EFF Large Wordlist for Passphrases in~/.eff_large_wordlist.txt, copies~/.bashrc.dand~/.bashrcfrom my bashrc repo (can be updated by runningupdate_bashrc. Put your overrides in~/.bashrc.overrides. Tools and configurations installed by this script that is not managed by a package manager can be updated by runningupdate_tools. Tools installed by this script that is managed by a package managers can be updated by runningupdate_pm. Configurations installed by these scripts can be updated withupdate_config. Allupdate_*functions can be run by runningupdate_all.), and more, on Ubuntu or Debian ARM64 Proot environment.
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.
proot-termux.sh: Boot Termux Proot-distro environments installed intermux-setup.shwith--isolated --fix-low-ports --no-arch-warning. See Termux Setup section for more information.proot-ubuntu.sh,proot-debian.sh: Boot those Proot-distro environments installed intermux-setup.shrespectively.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(no longer actively maintained): 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.
storage.sh:cd /storage/emulated/0.documents.sh,download.sh,scripts.sh:cdthose directories in/storage/emulated/0respectively.xmrig-xmr.sh: Mines XMR to the repository owner's wallet,48j6iQDeCSDeH46gw4dPJnMsa6TQzPa6WJaYbBS9JJucKqg9Mkt5EDe9nSkES3b8u7V6XJfL8neAPAtbEpmV2f4XC7bdbkv, using my modified version of XMRig and through Tor, which is not installed in the Termux Setup and can be installed withxmrig-install.sh. Change the wallet address and other configurations if you want.
These scripts are not invoked by Termux Setup. Run it separately if you need it.
persistent-notifications-rish.sh: On Android 14+, let persistent notifications posted by all apps of user 0 and user 10 not be dismissible through the UI (i.e. behave as they did prior to Android 14) (run in ADB shell) assuming that interactive ADB shell can be accessed withrish. See my Samsung-Android-Debloat-List repo for more information.persistent-notifications-adb.sh: On Android 14+, let persistent notifications posted by all apps of user 0 and user 10 not be dismissible through the UI (i.e. behave as they did prior to Android 14) (run in ADB shell) assuming that ADB is connected withadb shellavailable. See my Samsung-Android-Debloat-List repo for more information.disable-phantom-process-killer-rish.sh: Disable phantom process killer to resolveProcess completed (signal 9) - press Entererror assuming that interactive ADB shell can be accessed withrish. See https://willie169.github.io/Android-Non-Root/#process-completed-signal-9---press-enter-error for more information.disable-phantom-process-killer-adb.sh: Disable phantom process killer to resolveProcess completed (signal 9) - press Entererror assuming that ADB is connected withadb shellavailable. See https://willie169.github.io/Android-Non-Root/#process-completed-signal-9---press-enter-error for more information.xmrig-install.sh: Builds my modified version of XMRig, an open source, cross-platform RandomX, KawPow, CryptoNight and GhostRider CPU/GPU miner, RandomX benchmark, and stratum proxy, on Termux.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(no longer actively maintained): 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.
This repository is licensed under GNU General Public License General Public License, see LICENSE.md for details.
- https://andronix.app
- https://github.com/AndronixApp/AndronixOrigin
- https://github.com/sagar040/proot-distro-nethunter
- https://github.com/robertkirkman/termux-on-gha
- https://github.com/termux/proot-distro
- https://github.com/termux/termux-app
- https://ivonblog.com
- https://wiki.termux.com
- https://www.qemu.org