一、说明
纯粹看着那个破手机放在那里碍眼,折腾折腾,后盖都没了,电话别人听不到声音
二、Termux APK安装
https://github.com/termux/termux-app/releaseshttps://github.com/termux/termux-app/releases
下载后安装
三、更新软件包
安装完后打开Termux软件,进行软件包的更新
apt update
apt upgrade
四、替换镜像源
sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.listsed -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.listsed -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.listapt update && apt upgrade
五、安装sudo
# 一开始是不能用sudo命令的,所以需要输入安装sudo
pkg install tsu
六、安装Ubuntu
1. 安装proot-distro
pkg install proot-distro
2、查看可安装的Linux系统
proot-distro list
3、 开始安装Ubuntu
proot-distro install ubuntu
4、登录ubuntu
proot-distro login ubuntu
不能使用systemctl
deepseek解释
为什么
systemctl
无法使用?
底层机制限制
systemctl
是systemd
(Linux 系统的初始化和管理工具)的核心命令,需要完整的systemd
进程和 PID 1(系统初始化进程)的支持。
proot
环境本质上是用户态模拟,无法启动真正的systemd
服务,因此systemctl
会报错(如Failed to connect to bus
或System has not been booted with systemd
)。权限隔离
proot
未获取 Root 权限,无法直接操作底层系统服务,只能模拟文件系统和部分资源访问
玩玩还可以