2026年7月,在termux下试装alphie linux

下载 alphine linux 的 rootfs文件并安装
  1. 地址是,http://mirrors.aliyun.com/alpine/latest-stable/releases/aarch64/?spm=a2c6h.25603864.0.0.59865e6caRiYXM
  2. 采用我以前的文章中的脚本改进把alphine的rootfs解压
进入alphine, 由于alphine中没有bash, 只有ash, 所以star脚本有些不同
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/data/data/com.termux/files/usr/bin/sh
cd $(dirname $0)
## unset LD_PRELOAD in case termux-exec is installed
unset LD_PRELOAD
command="proot"
command+=" --link2symlink"
command+=" -0"
command+=" -r debian13"
if [ -n "$(ls -A ubuntu-binds)" ]; then
for f in ubuntu-binds/* ;do
. $f
done
fi
command+=" -b /dev"
command+=" -b /proc"
command+=" -b debian13/root:/dev/shm"
## uncomment the following line to have access to the home directory of termux
#command+=" -b /data/data/com.termux/files/home:/root"
## uncomment the following line to mount /sdcard directly to /
command+=" -b /sdcard"
command+=" -b /storage"
command+=" -w /root"
command+=" /usr/bin/env -i"
command+=" HOME=/root"
command+=" PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games"
command+=" TERM=$TERM"
command+=" LANG=C.UTF-8"
command+=" /bin/ash --login"
com="$@"
if [ -z "$1" ];then
exec $command
else
$command -c "$com"
fi
设置
1
2
3
4
5
6
7
8
9
10
cat > /etc/resolv.conf <<EOF
nameserver 223.5.5.5
nameserver 1.1.1.1
nameserver 8.8.8.8
EOF
sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirrors.tuna.tsinghua.edu.cn/alpine|g' /etc/apk/repositories # 设置成清华源
apk update
apk upgrade
apk install vim-full