CentOS 在 yum update 過程中強制重啟,啟動過程報錯:Attempted to kill init! exitcode=0x00007f00,進入內核恐慌,無法進入系統。
更新內核、systemd、glibc 等核心包時,若中斷(斷電、殺進程),導致:
initramfs 未重建或損壞。init 進程(PID 1)無法啟動。/mnt/sysimage。chroot /mnt/sysimage 切換到目標系統環境。yum reinstall kernel -y
dracut -f /boot/initramfs-$(uname -r).img $(uname -r)
touch /.autorelabel
# 或
restorecon -Rv /
exit; reboot。備份 /home、/etc、/var/www 等關鍵數據,重新安裝系統更省時。
yum update --downloadonly 先下載再安裝。dnf-automatic 定時更新並自動重啟(需測試)。