第一步:打开termux
每二步:安装proot-distro
pkg update
pkg install proot-distro
第三步:安装ubuntu
proot-distro install ubuntu
现在安装的就是24.04 也可以安装老版的 ,proot-distro list查看所有可安装版本 然后对应安装就行了
第四步:进入ubuntu
proot-distro login ubuntu
首先按默认源update
apt update
安装ca-certificates , dialog
apt install ca-certificates dialog
然后备份sources.list
cp /etc/apt/sources.list /etc/apt/sources.list.bak
修改sources.list
vim /etc/apt/sources.list
疯狂按d,清空文档,不清空的话,会影响以后update速度
清空后esc :wq保存退出
第五步:修改ubuntu.sources
vim /etc/apt/sources.list.d/ubuntu.sources
因为原来是没有这个文件的,所以打开后什么都没有,直接i进入编辑模式
粘贴下面的文本
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
然后esc :wq保存退出
第六步,apt update
至此大功造成,哎哟,累死了,一身汗。
另外, 由于proot下的ubuntu是个精简版,所以缺少很多部件,碰到问题解决问题就行了
附赠,重置ubuntu命令:proot-distro reset ubuntu.