云服务器安装 AlpineLinux 系统(从网络安装)

各大云厂商提供了种类繁多的系统镜像,但唯独这个小巧可爱的Alpine无人问津。不过也难不倒咱们这些具有折腾精神的极客们。

本教程支持且不限于阿里云、腾讯云、微软云、谷歌云。

1、重置为Debian10系统,通过VNC/Console登录控制台

2、设置为从AlpineLinux内核启动系统

mkdir -p /netboot && cd /netboot

rgeo=`wget -qO- https://ipip.rehi.org/country_code`

if [ "$rgeo" == "CN" ]; then
  repo=https://mirrors.tuna.tsinghua.edu.cn/alpine/edge
else
  repo=https://dl-cdn.alpinelinux.org/alpine/edge
fi

wget $repo/releases/x86_64/netboot/vmlinuz-virt
wget $repo/releases/x86_64/netboot/initramfs-virt
modl=$repo/releases/x86_64/netboot/modloop-virt

cat >> /etc/grub.d/40_custom <<EOF
menuentry "Alpine Linux Minimal" {
    search --set=root --file /netboot/vmlinuz-virt
    linux /netboot/vmlinuz-virt console=tty0 console=ttyS0,115200 ip=dhcp modloop=$modl alpine_repo=$repo/main/
    initrd /netboot/initramfs-virt
}
EOF

sed -i 's/GRUB_DEFAULT=0/GRUB_DEFAULT="Alpine Linux Minimal"/' /etc/default/grub

update-grub
reboot

2、执行安装脚本,接下来就需要看你自己的啦~

modprobe ext4
setup-alpine

其他安装方法

AlpineLinux 国内镜像

sed -i 's/dl-cdn.alpinelinux.org/mirrors.nju.edu.cn/g' /etc/apk/repositories
最后修改于:2023年05月03日 20:12

添加新评论