转载:
问题:
I am trying to install grub2 from a live CD of lubuntu 16.04, I am following this tutorial, after I mounted the /dev/sda1
in the mnt folder using this commands
sudo mount /dev/sda1 /mnt
sudo mount /dev/sda1 /mnt/boot
sudo mount --bind /dev /mnt/dev
Then changing the root directory :
sudo chroot /mnt
But when try installing grub using sudo grub-install /dev/sda
I get this error :
sudo: unable to resolve host ubuntu
grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory.
I tried turning off the uefi mode from bios but I think that my bios version doesn't even support it because it is from 2005
=========================================================================
解答:
Dont know if you solved your problem, thus this is 1y ago.
I ran into a same situation recently in Ubuntu 18.04, that chroot to another directory and run grub-install:
$ chroot /media/cdrom0 grub-install
Throws error:
grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory.
Finally solved this error by installing grub-pc:
$ sudo apt-get install grub-pc
After this, items under /usr/lib/grub changed from:
grub-mkconfig_lib x86_64-efi x86_64-efi_signed
To:
grub-mkconfig_lib i386-pc x86_64-efi