介绍
Termux是一个适用于 Android 的终端模拟器,其环境类似于 Linux 环境。 无需Root或设置即可使用。 Termux 会自动进行最小安装 - 使用 APT 包管理器即可获得其他软件包。
GitHub:https://github.com/termux/termux-app
下载安装
通过F-droid下载
地址:https://f-droid.org/packages/com.termux/
通过GitHub下载
地址:https://github.com/termux/termux-app/releases/
换源
参考:https://help.mirrors.cernet.edu.cn/termux/
安装需要的包
pkg install vim proot-distro -y
pkg install vim proot-distro -y
下载并运行Debian
输入proot-distro list查看可安装的系统
proot-distro list
输出示例如下:
~ $ proot-distro list
Supported distributions:
* Alpine Linux
Alias: alpine
Installed: no
Comment: Rolling release branch (edge).
* Arch Linux
Alias: archlinux
Installed: no
Comment: Currently available only AArch64 and ARM ports.
* Artix Linux
Alias: artix
Installed: no
Comment: Currently available only for AArch64.
* Debian (bookworm)
Alias: debian
Installed: no
Comment: Stable release.
* Debian (bullseye)
Alias: debian-oldstable
Installed: no
Comment: Old stable release.
* deepin
Alias: deepin
Installed: no
Comment: Supports only 64-bit CPUs.
* Fedora
Alias: fedora
Installed: no
Comment: Version 40. Supports only 64-bit CPUs.
* Manjaro
Alias: manjaro
Installed: no
Comment: Currently available only for AArch64.
* OpenKylin
Alias: openkylin
Installed: no
Comment: Version 'nile'. Supports only 64-bit CPUs.
* OpenSUSE
Alias: opensuse
Installed: no
Comment: Rolling release (Tumbleweed).
* Pardus
Alias: pardus
Installed: no
Comment: Version 'yirmibir'. Not available for ARM 32 bit.
* Ubuntu (24.04)
Alias: ubuntu
Installed: no
Comment: LTS release (noble). Not available for x86 32-bit (i686) CPUs.
* Ubuntu (22.04)
Alias: ubuntu-oldlts
Installed: no
Comment: Previous LTS release (jammy). Not available for x86 32-bit (i686) CPUs.
* Void Linux
Alias: void
Installed: no
Install selected one with: proot-distro install <alias>
安装
proot-distro install debian
proot-distro install debian
然后经历漫长的等待后安装成功。
大概这个样子:
使用
进入
proot-distro login debian
proot-distro login debian
输出:
~ $ proot-distro login debian
root@localhost:~#
换源
进入后,参考:https://help.mirrors.cernet.edu.cn/debian/
退出
exit
exit
输出:
root@localhost:~# exit
logout
~ $
打开时自动进入
编辑“$PREFIX/etc/profile.d/启动Debian.sh”
echo '#!/data/data/com.termux/files/usr/bin/bash
proot-distro login debian' > $PREFIX/etc/profile.d/启动Debian.sh
echo '#!/data/data/com.termux/files/usr/bin/bash
proot-distro login debian' > $PREFIX/etc/profile.d/启动Debian.sh
备份与还原
备份到Debian.tar.gz
proot-distro backup debian --output Debian.tar.gz
proot-distro backup debian --output Debian.tar.gz
通过Debian.tar.gz还原
proot-distro restore Debian.tar.gz
proot-distro restore Debian.tar.gz