When you are updating your system with pacman, you should generally always let the command complete fully without interruption. However, sometimes the update is interrupted - for example when
- your terminal/dekstop/xorg crashes while updating and takes the pacman process with it
- computer is shut down by power outage or third party involvement
A broken update can result in an unbootable system, if the kernel is updated, but the post update hooks have not yet been executed. After choosing manjaro from grub, you get a message saying "Failed to load kernel modules" and other errors. Fortunately, this is usually easy to fix.
What you need:
- Another linux system, preferrably manjaro or arch linux
- this can be a live cd/usb, a grub entry to boot a linux iso (see here: Booting Manjaro iso using grub2) or another linux installation in a multiboot environment
- you should keep one or more of these available at all times
- to chill out and not panic
Step 1
Boot to your other linux system.
Step 2
Mount the root partition of the system that you are fixing.
You can check your partition layout with the command
lsblk
We are assuming now that your broken system is in the partition /dev/sda2.
sudo su
mkdir /mnt
mount /dev/sda2 /mnt
or
If you have installed on btrfs subvolume (for example the standard @), you need to mount your root partition like this:
mount -o subvol=@ /dev/sda2 /mnt
In an uefi system, you should also usually mount your EFI partition (for example /dev/sda1)
mount /dev/sda1 /mnt/boot/efi
If you have a separate /boot partition (for example /dev/sda3) , you need to mount that too:
mount /dev/sda3 /mnt/boot
Step 3
Chroot into your broken system.
manjaro-chroot /mnt /bash
OR if using arch linux
arch-chroot /mnt /bash
OR if using some other linux, chroot with manual method:
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev
mount -t devpts pts /mnt/dev/pts/
chroot /mnt
OR if if using some other linux in a uefi environment
modprobe efivars
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev
mount -t devpts pts /mnt/dev/pts/
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
chroot /mnt
STEP 4
Complete the update properly.
Following set of commands takes care of various things that may have gone wrong with the update:
pacman -Syu
mkinitcpio -P
update-grub
The first updates the system. Second command rebuilds initramfs for all installed kernels. Third command updates grub, so that entries for all the kernels are up to date.
Step 5
Profit.
Your manjaro installation should now be bootable again.