[HowTo] Recovering from an interrupted update/upgrade

Difficulty: ★★☆☆☆


So you couldn’t wait until the update process had completed and you went for the reset/power button, didn’t you? :smiley: And now you’re getting the message that you don’t have a kernel installed. Well, you’re not the only one — we’re seeing it happen all the time. :wink:

So, here’s how to fix it, you impatient n00b. :stuck_out_tongue_winking_eye:

If you don’t happen to have a recent Manjaro installer USB/DVD/CD handy, direct your browser to this wonderful page, download the .iso of your choice, put it on a USB stick in the proper manner — Ventoy is a great way of creating bootable USB sticks, and it’s available for Microsoft Windows too if that is what you’re currently using — and then boot up from it in live mode.

Once the desktop has loaded, open up a terminal window. In this window, issue the following command… :arrow_down:

sudo su -

From here on, the methodology will differ depending on whether you have ext4 or btrfs. If your filesystems are ext4, then it’s as simple as issuing the following command… :arrow_down:

manjaro-chroot -a

If you have more than one GNU/Linux system on your machine, select the number that corresponds to the Manjaro installation that needs to be repaired. manjaro-chroot will then automatically mount all of the pertinent filesystems.

If on the other hand you are using btrfs with the default setup, then you’re going to need a number of extra steps. In the instructions below, I will for the sake of this tutorial assume that…

  • your machine boots in native UEFI mode;
  • your EFI system partition is on /dev/sda1; and…
  • your root filesystem is on /dev/sda2 and uses the default subvolume layout as installed by calamares (i.e. the Manjaro installer).

It is of course important that you adapt the instructions below to your actual situation — i.e. you should use the actual block devices for the EFI partition and the btrfs volume on your machine — but with the default configuration in mind, here’s how you would chroot into your btrfs installation… :arrow_down:

mount -t btrfs -o subvol=@ /dev/sda2 /mnt
mount -t btrfs -o subvol=@home /dev/sda2 /mnt/home
mount -t btrfs -o subvol=@log /dev/sda2 /mnt/var/log
mount -t btrfs -o subvol=@cache /dev/sda2 /mnt/var/cache
mount -t vfat  /dev/sda1 /mnt/boot/efi
mount --bind /dev /mnt/dev
mount -t proc proc /mnt/proc
mount -t sysfs sysfs /mnt/sys
mount -t efivarfs efivarfs /mnt/sys/firmware/efi/efivars
chroot /mnt /bin/bash

After chrooting — regardless of whether you used manjaro-chroot with ext4 or a manual chroot with btrfs — you must now issue the following commands to repair your installation… :arrow_down:

[ -f /var/lib/pacman/db.lck ] && rm -f /var/lib/pacman/db.lck
pacman-mirrors -f && pacman -Syyu
update-grub
exit

Be sure to let all of the above commands take their time and finish up. When prompted for the replacement of certain packages, be sure to answer Y.

After all of the above has been done, cleanly reboot your machine and remove the USB stick.


Useful sites… :arrow_down:

14 Likes