Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required. A minimal base system is installed automatically - additional packages are available using the APT package manager.(官网)
首次启动需要自动安装环境(可能需要翻墙)
换源(可选)
国内更换清华镜像源
方案一
使用内置的更换更新源GUI程序
1
termux-change-repo
方案二
通过脚本自动更换更新源
1 2 3 4 5
sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@'$PREFIX/etc/apt/sources.list
sed -i 's@^\(deb.*games stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@'$PREFIX/etc/apt/sources.list.d/game.list
sed -i 's@^\(deb.*science stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@'$PREFIX/etc/apt/sources.list.d/science.list
方案三
手工指定更新源(通过自带程序编辑配置文件)
这种方法需要有vim编辑器,没有的话要先安装
1 2
export EDITOR=vi apt exit-sources
$PREFIX/etc/apt/sources.list
1
deb https://mirrors.tuna.tsinghua.edu.cn/termux stable main