安装并运行完整Linux
- 下载termux…
- 将termux的软件源换成清华源(https://mirrors.tuna.tsinghua.edu.cn/help/termux/):
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
apt update && apt upgrade
- 安装必要软件以模拟linux完整的文件系统环境:
pkg i proot
并开启模拟linux文件系统:termux-chroot
(termux默认情况下并没有完整的linux文件环境,比如输入ls ~/..
只能看到有 /home 和 /usr 两个文件夹,如果termux-chroot
之后就能看到别的linux应该有的文件夹了) - 安装atilo(项目地址:https://github.com/YadominJinta/atilo):
echo "deb [trusted=yes arch=all] https://yadominjinta.github.io/files/ termux extras" >> $PREFIX/etc/apt/sources.list.d/atilo.list
apt update && apt install atilo-cn
- 安装完整ubuntu镜像:
atilo pull ubuntu
- 运行完整ubuntu镜像:
atilo run ubuntu
- 将ubuntu的软件源换成清华源(https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu-ports/)
使用清华源时使用HTTPS可有效避免国内运营商的缓存劫持,但需要事先安装 apt-transport-https:sudo apt install apt-transport-https
操作前请做好相应备份 - 运行
sudo apt update
更新索引以生效
安装openssh并使用电脑进行远程操作
- 进入termux为termux设置密码:
passwd
- 为termux下载openssh:
pkg upgrade
pkg i openssh
- 开启ssh:
sshd
- 在电脑端链接termux:
ssh -P 8022 user@hostname_or_ip
并按提示输入密码(termux的ssh-server默认使用8022端口)
其中:user
在termux中输入 whoami
来查看
hostname_or_ip
ip可在termux中输入 ifconfig
来查看 - 可以愉快地玩耍了!