Termux-Setup-Guide

Termux Setup Guide

Termux Setup Guide

This guide helps you set up Termux with essential packages and languages. If you encounter errors or issues with certain tools in Termux, follow these steps for troubleshooting:

Installation

  1. Download Termux: Ensure you have the latest version of Termux installed from GitHub or F-Droid.
  2. Copy & Paste Commands: Run the following commands in your Termux terminal:
pkg update && pkg upgrade && pkg install git python python2 && pkg install wget ruby proot clang && termux-setup-storage && apt install php git golang -y && apt install nano && apt install cmatrix && pkg install figlet && pkg install wget && pkg install cowsay && pkg install toilet && pkg install ruby && gem install lolcat && pkg install curl && pkg install unzip && pkg install openssh && pkg install tor && pkg install net-tools && pkg install unrar && pkg install clang && pkg install w3m && pkg install proot && pip2 install wget && pip2 install requests && pkg install pacman4console && pkg install vim && pip install colorama && pip install bundle && gem install bundle && gem install bundler && pip2 install requests && pip install --upgrade pip

🛠️ Troubleshooting & Error Fixes

Common Issues & Solutions

Package Installation Errors

# If packages fail to install
pkg update --fix-missing
pkg upgrade -y
termux-change-repo  # Change to a faster mirror

Storage Permission Issues

# Fix storage access problems
termux-setup-storage
# If it fails:
rm -rf ~/storage
termux-setup-storage

“Command Not Found” Errors

# Fix missing commands
pkg update
pkg install command-not-found -y
source $PREFIX/etc/profile.d/command-not-found.sh

Python/Pip Issues

# Fix Python environment
pkg reinstall python -y
pip install --upgrade pip
pip install wheel setuptools

Quick Fix Commands

Reset Environment

# Refresh shell environment
source ~/.bashrc
exec bash  # Restart shell

Clear Cache & Free Space

# Clean system cache
pkg clean
apt autoremove -y
rm -rf ~/.cache/* ~/.tmp/*

Fix Broken Packages

# Reinstall broken packages
pkg reinstall $(pkg list-installed | grep -v ok | cut -d/ -f1)

Important Commands

pkg install texinfo -y && info > commands.txt && cat commands.txt
pkg --check-mirror update
pkg install git -y
pkg install fish -y

Languages Installation

Ensure the following languages are installed for development:

apt install python -y
apt install python2 -y
apt install ruby -y
apt install php -y
apt install golang -y

Important Commands

Command Description
pkg list-all List all available packages
pkg search <tool> Search for a package
pkg show <package> Show package details
termux-info Display Termux system info
termux-open <file> Open a file
termux-clipboard-set Copy text to clipboard

🚨 Emergency Recovery

System Won’t Start

# If Termux crashes completely
# Uninstall and reinstall the app
# Then restore from backup or start fresh

Complete Reset

# Nuclear option - reset everything
rm -rf $PREFIX
pkg update && pkg upgrade

Backup Before Fixing

# Always backup first!
tar -zcf backup-before-fix.tar.gz /data/data/com.termux/files

Optimization & Maintenance

🔧 Advanced Troubleshooting

Library Issues

# Fix shared library problems
pkg install libandroid-support -y
pkg reinstall $PREFIX/bin/*

Permission Problems

# Fix file permissions
chmod 755 $PREFIX/bin/*
chmod +x ~/storage/shared/termux-scripts/*.sh 2>/dev/null || true

Memory Issues

# Check system resources
free -m
df -h
# If low on memory:
pkg clean
rm -rf ~/.cache

Pro Tips

☕️ Support My Work

Binance

Binance Pay QR