Skip to content

Termux setup and utility scripts for development tools, proot, QEMU, box86, and more.

License

Notifications You must be signed in to change notification settings

Willie169/termux-sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

896 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

termux-sh

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.

Table of Contents

Termux

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.

Termux Setup

termux-setup.sh

Prerequisites

  • 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, and
      TERMUX=''
      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, and
      TERMUX='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 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: https://willie169.github.io/Android-Non-Root/#process-completed-signal-9---press-enter-error for the fixes.

Execution

  1. termux-setup-storage
    pkg update && pkg install git -y
    cd ~ && git clone https://github.com/Willie169/termux-sh.git
    
  2. Optionally edit the variables in the beginning of ~/termux-sh/termux-setup.sh (nano for example). In VM names variables, (space) will be replaced with _, names that are not allowed will be added a suffix 1:
    pkg install nano
    nano ~/termux-sh/termux-setup.sh
    
  3. Run the setup script:
    bash ~/termux-sh/termux-setup.sh
    
  4. Follow the prompts until it exits automatically.
  5. Run gh auth login --scopes repo,read:org,admin:org,workflow,gist,notifications,delete_repo,write:packages,read:packages to login to GitHub.
  6. Run git config --global user.name [your_name] && git config --global user.email [your_email] to config git.

Content

The variables below refer to the variables set in the beginning of termux-setup.sh.

  1. Termux properties adjustments: Enables external app access in termux.properties.
  2. Shortcut configuration: Copies shortcuts from DOTshortcuts into ~/.shortcuts folder (for Termux:Widget) and Documents.sh, Download.sh, Storage.sh into home directory ~. See Shortcuts section for more information.
  3. Bashrc configuration: Copies ~/.bashrc.d and ~/.bashrc from my bashrc repo (can be updated with update_bashrc).
  4. 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.
  5. XFCE desktop environment: Installs TigerVNC server and XFCE desktop environment, and configures vncserver to launch XFCE4 desktop environment if not XFCE=0.
  6. Android Build Environment Setup: Setup Android apps build environment if not ANDROID=0 using script modified from my termux-android-sdk-ndk repo. Refer to it for more information.
  7. Vim configuration: Install my modified version of vimrc by Amir Salihefendic (amix) for both Vim and Neovim if not VIMRC=0.
  8. NPM packages: Installs NPM packages set in $NPM locally in ~ and NPM packages set in $NPMG globally. The default $NPM is jsdom markdown-toc marked marked-gfm-heading-id node-html-markdown showdown. The default $NPMG is http-server @openai/codex.
  9. Pip packages: Installs pip packages set in PIP. The default one is jupyter matplotlib meson numpy pandas plotly pydub requests selenium setuptools sympy.
  10. Go packages: Installs Go packages set in GO. The default one is empty.
  11. JARs: Installs ANTLR 4 (JAR in /usr/local/java) if not ANTLR=0 and PlantUML (JAR in /usr/local/java) if not PLANTUML=0.
  12. Proot-distro Termux environment: Installs an Termux proot-distro environment with alias $TERMUX and add boot script proot-$TERMUX.sh into home directory ~ and ~/.shortcuts folder (for Termux:Widget) if $TERMUX is not empty string.
  13. Proot-distro Ubuntu environment: Installs an Ubuntu ARM64 proot-distro environment with alias $UBUNTU and add boot script proot-$UBUNTU.sh into home directory ~ and ~/.shortcuts folder (for Termux:Widget) if $UBUNTU is not empty string, and runs ubuntu-debian.sh in it if $UBUNTU is not empty string and $UBUNTUINSTALL is not 0. See Invoked VM Setup Scripts section for more information.ollama pull llama3.2,
  14. Proot-distro Debian environment: Installs Debian ARM64 proot-distro environment with alias $DEBIAN and add boot script proot-$DEBIAN.sh into home directory ~ and ~/.shortcuts folder (for Termux:Widget) if $DEBIAN is not empty string, and runs ubuntu-debian.sh in it if $DEBIAN is not empty string and $DEBIANINSTALL is not 0. See Invoked VM Setup Scripts section for more information.
  15. Proot-distro Ubuntu environment with Box64, Wine64, and Winetricks (not invoked by default): Installs Ubuntu ARM64 proot-distro environment with alias $UBUNTUBOX and add boot script proot-$UBUNTUBOX.sh into home directory ~ and ~/.shortcuts folder (for Termux:Widget) if $UBUNTUBOX is not empty string, and runs box64-wine64-winetricks.sh (no longer actively maintained) in it if $UBUNTUBOX is not empty string and $UBUNTUBOXINSTALL is not 0. See Invoked VM Setup Scripts section for more information.
  16. Proot-distro Debian environment with Box64, Wine64, and Winetricks (not invoked by default): Installs Debian ARM64 proot-distro environment with alias $DEBIANBOX and add boot script proot-$DEBIANBOX.sh into home directory ~ and ~/.shortcuts folder (for Termux:Widget) if $DEBIANBOX is not empty string, and runs box64-wine64-winetricks.sh (no longer actively maintained) in it if $DEBIANBOX is not empty string and $DEBIANBOXINSTALL is not 0. See Invoked VM Setup Scripts section for more information.

Invoked VM Setup Scripts

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 unrestricted tlmgr and updates), Maven, Zsh, iproute2, net-tools, aria2, nvm, pnpm, Yarn, NPM packages jsdom markdown-toc marked marked-gfm-heading-id node-html-markdown showdown locally in ~ and http-server @openai/codex globally, GNU Chess, GNU Go, Aider, Ollama with llama3.2:1b pulled, 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 stuck elementary-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/katago and can be run with katago) and KataGo network kata1-b6c96-s175395328-d26788732 (in ~/katago-networks, other networks can be downloaded from https://katagotraining.org/networks), LizzieYzy (can be launched by running lizzieyzy or with desktop entry ~/.local/share/applications/lizzieyzy.desktop or ~/desktop/lizzieyzy.desktop, runtime directory ~/.lizzieyzy, KataGo network kata1-b6c96-s175395328-d26788732 configured as default engine and estimate engine in ~/.lizzieyzy/config.txt, which can be updated by running update_lizzieyzy_config), Fairy-Stockfish (~/Fairy-Stockfish/src/stockfish and can be run with stockfish), Cute Chess (GUI at ~/cutechess/build/cutechess and can be launched by running cutechess or with desktop entry ~/.local/share/applications/cutechess.desktop or ~/desktop/cutechess.desktop, CLI at ~/cutechess/build/cutechess-cli and can be run with cutechess-cli, Fairy-Stockfish configured as engine in ~/.config/cutechess/engines.json, which can be updated by running update_cutechess_config), Sylvan (GUI at ~/Sylvan/projects/gui/sylvan and can be launched by running sylvan or with desktop entry ~/.local/share/applications/sylvan.desktop or ~/desktop/sylvan.desktop, CLI at ~/Sylvan/projects/cli/sylvan-cli and can be run with sylvan-cli, Fairy-Stockfish configured as engine in ~/.config/EterCyber/engines.json, which can be updated by running update_sylvan_config), my modified version of vimrc by Amir Salihefendic (amix) for both Vim and Neovim (can be updated by running update_vimrc), my LaTeX package physics-patch and my LaTeX template LaTeX-ToolKit (can be updated with update_latex), and more, and copies ~/.bashrc.d and ~/.bashrc from my bashrc repo (can be updated by running update_bashrc), on Ubuntu or Debian ARM64 Proot environment.
  • box64-wine64-winetricks.sh: Installs box64, wine64, and winetricks for running x86_64 Linux and Windows applications on Debian derivatives ARM64. (No longer actively maintained.)

Shortcuts

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.

Boot VM Scripts

Utility Scripts

Additional Scripts

These scripts are not invoked by Termux Setup. Run it separately if you need it.

License

This repository is licensed under GNU General Public License General Public License, see LICENSE.md for details.

Credits

About

Termux setup and utility scripts for development tools, proot, QEMU, box86, and more.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages