很多软件都不提供FreeBSD的二进制包,自行编译有时会遇到一些难以解决的依赖问题,这令我有了回归Debian怀抱的想法。这想法在昨晚达到了顶峰,我打定主意要攻克这项工程。
腾讯云轻量应用服务器其实有官方的Debian镜像,但里面包含的云镜组件却令我不快。我转而使用dd命令手动安装,流程大致如下。
wget https://github.com/mmatuska/mfslinux/releases/download/0.1.8/mfslinux-0.1.8-87f3bbd.iso -O /boot/mfs.iso
echo "
menuentry "mfs"{
set isofile="/boot/mfs.iso"
loopback loop (hd0,1)\$isofile
linux (loop)/isolinux/vmlinuz
initrd (loop)/isolinux/initramfs.igz
}
" >> /etc/grub.d/40_custom
update-grub
reboot
#进入webvnc,选择mfs引导项。
wget -O- https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.tar.xz | tar xJOf - | dd of=/dev/vda
至此一切顺利,但我重启之后发现云镜依然阴魂不散。
邪门!我将相同的命令在虚拟机中运行了一遍,毫无疑问是纯净的Debian Buster。
无奈之下我在交流群里发言求助,大佬指出可能是cloud-init
造成的。根据官网的说法,cloud-init
用于自动向实例应用一些操作,完全可以达到这样的效果……
It is the user data that gives every cloud instance its personality and cloud-init is the tool that applies user data to your instances automatically.
解决方案也很简单,删掉cloud-init
即可。
mount /dev/vda1 /mnt
chroot /mnt
apt remove cloud-init
#顺便修改密码……
passwd
exit
reboot
本文由 徐艺扬 创作,采用 知识共享署名4.0
国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Apr 22,2022