使用termux安装debian11
1.下载 Termux
2.配置 Termux
2.1 切换到清华源
sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list2.2 安装 ssh
pkg install openssh2.3 设置 Termux 密码
passwd2.4 开启 ssh 服务
sshd2.5 可能会遇到的问题

2.5.1 需要更新一下软件包
pkg update2.5.2 重新生成 key
ssh-keygen -A
然后再尝试使用sshd启动服务
2.6 连接 ssh
使用常见的 ssh 连接工具 xshell 等 连接时 ip 就是手机的 ip 端口是 8022 用户名是 user 密码就是上面设置的
3.安装 debian (同理也可以安装别的系统)
3.1 安装 proot-distro
pkg install proot-distro3.2 常用指令
# 查看帮助
proot-distro help
# 查询支持哪些发行版本
proot-distro list
3.3 安装 debian
中间可能需要连接到国际互联网
proot-distro install debian等待跑码完成. 
3.4 进入 debian
运行
proot-distro login debian即可进入 debian 啦~
4.配置 debian 系统
4.1 配置清华源
Debian 的软件源配置文件是 /etc/apt/sources.list进行修改 默认自带的文本编辑器是 nano,居然连 vi 都没有(小声)
vi /etc/apt/sources.list添加上下面这几段(推荐把自带源注释掉,在前面加上#即可)
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free修改完成后记得刷新一下
apt update4.2 修改语言(可不改)
4.2.1 安装 locales
apt-get install locales4.2.2 修改语言
dpkg-reconfigure locales选中zh_CN.UTF-8 UTF-8 (用上下切换,空格选中,回车继续)
把默认也改成zh_CN.UTF-8 UTF-8
等待一会儿就切换完成了
4.3 修改时区
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime使用 date 查看是否生效
5.收工
记得给 Termux 后台上锁,然后设置无限制,防止被杀后台