So I had a windows 10 installed on one of my partitions and all my files on the other. I decided to get rid of windows and install Ubuntu 16.04 . when attempted I chose something else and I chose to format the first partition to ext4 and mounted it to / and chose to format it. I also made a 960MB swap partition. I didn't connect my laptop to Internet during the installation. my device is Lenovo y50 with 256GB SSD hard drive. Then I had so many problems after installation then and I did the process so many time I guess one of the times I used BIOS instead of UEFI and then every time I had the error failed to install grub2 package to /target etc so I found somewhere that I should make a 200MB fat32 partition with boot flag. and I did and I finally could install my Ubuntu then whenever I wanted to install something I had a similar issue to this. So i ran this command:
sudo cp /boot/grub/x86_64-efi/modinfo.sh /usr/lib/grub/i386-pc/modinfo.sh
And then I started to have this new error:
After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Setting up grub-efi-amd64-signed (1.66.14+2.02~beta2-36ubuntu3.14) ... Installing for x86_64-efi platform. grub-install: error: cannot open `/usr/lib/grub/i386-pc/moddep.lst': No such file or directory. dpkg: error processing package grub-efi-amd64-signed (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: grub-efi-amd64-signed E: Sub-process /usr/bin/dpkg returned an error code (1)
So what should I do!? I'm really sick of this issue! Is there anyway I could completely unistall grub2 and reinstall it again? Is it safe and easy to use boot-repair? Where can I find the moddep.lst file!?
Update
I ran:
sudo cp /boot/grub/i386-pc/* /usr/lib/grub/i386-pc/
Now I get the following error:
Setting up grub-efi-amd64-signed (1.66.14+2.02~beta2-36ubuntu3.14) ... Installing for i386-pc platform. grub-install: error: install device isn't specified. dpkg: error processing package grub-efi-amd64-signed (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: grub-efi-amd64-signed E: Sub-process /usr/bin/dpkg returned an error code (1) actually I wonder why I have the i386 directory anyway since my system is 64bit and I have installed amd64.
I tried installing grub (I am using pop-os 20.10 LTS) with this command line
Worked out for me for all the missing dependencies.