Restore Grub without chroot - Live can't download mhwd/manjaro-chroot

Hello everyone, I need to know why in Manjaro live I can't use database to download mhwd-chroot or manjaro-chroot since when I try "sudo pacman -S name package" the output is "attention: database file for 'core' does not exist, attention: database file for 'extra' does not exist, attention: database file for 'community' does not exist, attention: database file for 'multilib' does not exist "

I need this in order to restore the Grub (I'm in grub rescue) because of a Windows update messing up the partition with Manjaro, else I can't use Linux anymore. How to use database in live in order to download and to use mhwd/manjaro chroot to repair manjaro partition and to save myself from grub rescue?

sudo pacman -Fyy && sudo pacman -S manjaro-tools-base mhwd-chroot

1 Like

Hello, the output of sudo pacman -Fyy is:

"error: impossible to update 'core' (impossible to block the database)"
Same lines for 'extra', 'community' and 'multilib'
"error: impossible to synch the database"
"Error: Initialization failed (it is not possible to block the database)
Error: it is impossible to block the database: Existing file
if you are sure that the package manager is not already in place
running, you can remove /var/lib/pacman/db. lck."

This is not about manjaro-chroot, but how to restore your grub (without chroot).
Below are steps assuming you have only one Manjaro OS installation, we can still fix it if you have more, just differently.

  1. Take the manjaro livecd and start it up in the same mode as your installation (uefi or bios-legacy).
  2. Do not boot up to live OS, but press ‘c’ at the menu and we’ll get to the grub prompt (grub>).
  3. To be sure you've started up livecd in the right mode, at grub prompt, check output of
    grub> echo $grub_platform
    If output is “pc”, you've booted up in bios-legacy.
    If output is “efi”, you've booted up in uefi.
    If you're in the wrong mode, reboot livecd in the right mode.
  4. grub> search.file /etc/manjaro-release root
    grub> configfile /boot/grub/grub.cfg
  5. You will be presented with your original manjaro grub menu.
    Use this and boot to manjaro.
    If you do not see this manjaro boot menu, you may have messed up during your chroot earlier.
    Operations during chroot can be mess things up if not done properly or not exited before further non-chroot commands.
  6. When booted up to manjaro installed OS, at terminal
    sudo grub-install
    sudo update-grub
    sudo cp /boot/grub/x86_64-efi/core.efi /boot/efi/EFI/boot/bootx64.efi
  7. Done.
1 Like

Well, it tells you right there. Make sure your octopi/pamac/whatever is fully closed ... then run the pacman command. It will correctly fail/complain if trying to run multiple managers at once.
Although its probably beside the point, as gohlip is our recover/partition expert par excellence and has provided instructions for your needs without chroot. Its up to you. My command will fix your issue and let you install packages, but you dont necessarily need to, as shown above.

1 Like

A sudo pacman -Syy will also redownload the databases from the mirrors, making those errors go away.

1 Like

Thank you, I followed the instructions of gohlip and it worked :slight_smile: both were in UEFI

I am now in the Manjaro partition installed OS, if I run sudo pacman -Syyu or -Fyy or -Syy there is the same output as the liveOS of Manjaro

"error: impossible to update ‘core’ (impossible to block the database)"
Same lines for ‘extra’, ‘community’ and ‘multilib’
“error: impossible to synch the database”
“Error: Initialization failed (it is not possible to block the database)
Error: it is impossible to block the database: Existing file
if you are sure that the package manager is not already in place
running, you can remove /var/lib/pacman/db. lck.”

I have no GUI of package manager opened, do you think I have to remove /var/lib/pacman/db.lck?
However the problem of the topic is solved, thanks

Yes, if you are sure no other instance of pacman/octopi/pamac/whatever is running then somehow that lock got stuck set.
(most likely by aborting an install or update halfway through - DONT DO THAT)
sudo rm /var/lib/pacman/db.lck
will remove it, then go ahead.

1 Like

Yeah, probably I've aborted something, I'll not do again anymore :slight_smile: Thanks again!

Sure thing.
Its ok at the propper prompts, such as yaourt saying 'you want to install?'>'N' .. just not all rough and tumble while compiling and such :wink:

Only when I've run the update it asks me if I want to change some package like ten times and after I've chosen it started to do the update, if you ask me this

Usually if asked to replace a package the needed answer is yes. An explanation can often be found in update or release announcements. Like recently there was a bunch of xorg-proto replacements because of packaging changes.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by