Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Started boot-repair on live-usb, removed grub, and then was instructed to write in terminal sudo chroot "/mnt/boot-sav/sda5" apt-get install -y --force-yes grub-pc linux but I get:

Reading package lists... Done 
Building dependency tree
Reading state information... Done
E: Unable to locate package linux

and it says grub is still absent.

share|improve this question
    
possible duplicate of Boot-repair can't complete a repair under Ubuntu Gnome 14.04 –  muru Aug 23 at 10:50

4 Answers 4

The original command should not be,

apt-get install -y --force-yes grub-pc linux

It should be,

apt-get install -y --force-yes grub-pc

If you run apt-get install -y --force-yes grub-pc linux command, apt-get tries to find and install the packages grub-pc and linux. But there is no such linux package available.

E: Unable to locate package linux

The above part from the error report is your clue.

The presence of "linux" in the install line is a bug in boot-repair, and should be reported there.

share|improve this answer
1  
thnx alot, it was too confusing for beginners like me. your answer did great help. –  Haider Ali Wajihi Nov 15 at 5:10

The command line reported by boot-repair is apt-get install -y --force-yes grub-pc linux

Whether or not the word "linux" should be there is a different question.

share|improve this answer

When prompted by Boot-Repair, please type this command in the terminal:

sudo chroot "/mnt/boot-sav/sda6" apt-get install -y --force-yes grub-pc

linux command in a terminal on 1 line only. In your question it appears broken on 2 lines.

share|improve this answer
    
I do write it on one line, it appears broken because it is the end of the line (I copy paste actually) –  user271668 Apr 20 at 22:59

I had the same problem with Boot Repair and found that if I omit the word "linux" from the end of the command, then it installs properly. For some reason Boot Repair says you should include the word (but again, you should not).

share|improve this answer

protected by Community Aug 23 at 6:29

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.