What to do if you accidentally remove the `amd-ucode` package on Arch Linux

anekos - Oct 9 - - Dev Community

Stuck with a boot error saying "amd-ucode.img not found" on Arch Linux? This guide shows you how to fix it fast.

Boot from Arch Linux USB drive

Use the official one from the Arch Linux website.

First, mount the target disk

# mkdir /mnt/root
# mount /dev/nvme0n1p2 /mnt/root
# mount /dev/nvme0n1p1 /mnt/root/boot
Enter fullscreen mode Exit fullscreen mode

Enter the mounted environment with chroot

# arch-chroot /mnt/root
Enter fullscreen mode Exit fullscreen mode

Reinstall the amd-ucode package that was accidentally removed

# pacman -S amd-ucode
Enter fullscreen mode Exit fullscreen mode

This should create /boot/amd-ucode.img.

Create a backup just in case

(If you put the backup in the same directory, grub-mkconfig would use that instead)

# cd /boot
# mkdir backup
# cp initramfs-linux.img backup/initramfs-linux.img.2024-10-08
# cp vmlinuz-linux backup/vmlinuz-linux.2024-10-08
# cp grub/grub.cfg backup/grub.cfg.2024-10-08
# cp /etc/mkinitcpio.conf backup/mkinitcpio.conf.2024-10-08
Enter fullscreen mode Exit fullscreen mode

Regenerate initramfs

# mkinitcpio -p linux
Enter fullscreen mode Exit fullscreen mode

Update GRUB configuration

# grub-mkconfig -o /boot/grub/grub.cfg
Enter fullscreen mode Exit fullscreen mode

Conclusion

Pacman: It's not just a game, folks!

.
Terabox Video Player