0

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.

2 Answers2

0

I tried installing grub (I am using pop-os 20.10 LTS) with this command line

sudo apt install grub-efi grub-common grub-customizer

Worked out for me for all the missing dependencies.

0

I have tried sudo apt install grub-efi grub-common grub-customizer then, what to do? – user1166068 Feb 26, 2021 at 9:30

I didn't see anyone pointing it out, so after running sudo apt install grub-efi grub-common grub-customizer should you get the device not specified error, simply add the device to the command like so

sudo grub-install /dev/[yourDeviceName]

Should be the same device you are running your system from, in my case /dev/sda for example.

To check mounted devices run df -h

  • Should be the same device you are running your system from Not necessarily. It must be the same device where the ESP (EFI System Partitions) is and that can be different from the one where the system is actually installed. It should be the same ONLY if you have a single drive. – ChanganAuto Dec 06 '22 at 00:53