PDA

View Full Version : [Fix]"grub-pc failed to install into /target/"[Fix]



n0bul4r
2014-03-26, 22:14
Hi,

Im new here, however, i come up with a solution.

I'm pulling my hair on this problem and that's why I want to write a solution that I hope will be useful.

The original problem :

When i install(legacy no uefi) Kali Linux on my asus ux31a, the install process continued normally but at the grub installation this error appeared : grub-pc failed to install into /target/thin

When i reboot, i have no OS, nothing ...

Solution:

I boot on my live of kali, then i chroot on the disk system :


sudo mount /dev/sdaX /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /sys /mnt/sys
sudo mount -t proc /proc /mnt/proc
sudo chroot /mnt /bin/bash
mount -a

I add the squeeze repository


vim /etc/apt/source.list
add this :
## Security updates
deb http://security.kali.org/kali-security kali/updates main contrib non-free
deb ftp://ftp.fr.debian.org/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main contrib non-free
# avant squeeze : deb http://volatile.debian.org/debian-volatile lenny/volatile main
deb ftp://ftp.fr.debian.org/debian/ squeeze-updates main contrib non-free
#optionnel :
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free

save

And i install grub


apt-get install grub-pc

I choose the /dev/sda disk for the install and i update the grub running config file with :


update-grub


in the hope that it may help you

valiance
2014-08-31, 06:09
I had done a full install of Kali to my ASUS Q550L, which completely wiped Windows 8. When installing Kali from my USB, GRUB failed, and I continued with the installation anyway, then booted from Live USB. I tried to do:

apt-get install grub-pc

And this also fails. Why is this?

staticn0de
2014-08-31, 22:42
Did you chroot your hard drive before trying to install grub?

Essentially, as far as grub us concerned you just tried to install it on the live usb.

You need to mount the file system of your install on /mnt and then chroot the directory so you can interact with it.

After that, try running the reinstall.

muts
2014-10-26, 13:24
Adding Debian repos to your Kali OS is a sure way to break your installation.

Elephant++
2015-02-28, 17:19
Tried this fix but another problem appeared when installing grub. It says package grub-pc is not available.
What shall I do ?
I add screenshot of whole process. http://s2.ifotos.pl/img/grubpcnoc_wnrwprr.png

Forgive me if this is unwise question, I'm not very experienced user.

staticn0de
2015-03-01, 04:15
Did you run apt-get update?

Elephant++
2015-03-07, 23:04
Unfortunately it ain't no solved the problem.
Console :

root@kali:~# apt-get update
Get:1 http://security.kali.org kali/updates Release.gpg [836 B]
Get:2 http://http.kali.org kali Release.gpg [836 B]
Get:3 http://security.kali.org kali/updates Release [11.0 kB]
Get:4 http://http.kali.org kali Release [21.1 kB]
Get:5 http://security.kali.org kali/updates/main Sources [144 kB]
Get:6 http://http.kali.org kali/main Sources [7568 kB]
Ign http://security.kali.org kali/updates/contrib Translation-en
Ign http://http.kali.org kali/contrib Translation-en
Ign http://security.kali.org kali/updates/main Translation-en
Ign http://http.kali.org kali/main Translation-en
Ign http://security.kali.org kali/updates/non-free Translation-en
Ign http://http.kali.org kali/non-free Translation-en
Hit http://security.kali.org kali/updates/contrib Sources
Hit http://http.kali.org kali/contrib Sources
Hit http://security.kali.org kali/updates/non-free Sources
Get:7 http://http.kali.org kali/non-free Sources [118 kB]
Get:8 http://security.kali.org kali/updates/main amd64 Packages [283 kB]
Get:9 http://http.kali.org kali/main amd64 Packages [8470 kB]
Hit http://security.kali.org kali/updates/contrib amd64 Packages
Hit http://http.kali.org kali/contrib amd64 Packages
Hit http://security.kali.org kali/updates/non-free amd64 Packages
Get:10 http://http.kali.org kali/non-free amd64 Packages [138 kB]
Fetched 16.8 MB in 49s (338 kB/s)
Reading package lists... Done
root@kali:~# chroot
chroot: missing operand
Try `chroot --help' for more information.
root@kali:~# sudo mount /dev/sda5 /mnt
root@kali:~# sudo mount --bind /dev /mnt/dev
root@kali:~# sudo mount --bind /dev/pts /mnt/dev/pts
root@kali:~# sudo mount --bind /sys /mnt/sys
root@kali:~# sudo mount -t proc /proc /mnt/proc
root@kali:~# sudo chroot /mnt /bin/bash
root@kali:/# mount -a
root@kali:/# leafpad /etc/apt/source.list
root@kali:/# apt-get install grub-pc
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package grub-pc is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'grub-pc' has no installation candidate
root@kali:/# apt-get update
Err http://security.kali.org kali/updates Release.gpg
Could not resolve 'security.kali.org'
Reading package lists... Done
W: Failed to fetch http://security.kali.org/kali-security/dists/kali/updates/Release.gpg Could not resolve 'security.kali.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.
root@kali:/# apt-get install grub-pc
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package grub-pc is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'grub-pc' has no installation candidate

staticn0de
2015-03-09, 04:03
Could not resolve? Are you on the internet?

If not, establish an internet connect that can resolve the repo before you try and install grub

carlospence
2016-02-06, 13:19
I have been having this issue for sometime now.

I have tried various method to resolve it and didn't work until i installed it with internet connection.

I booted the my laptop computer using kali live on a usb stick

Connected the system to a wireless internet connection by tethering my phone.

Started the installation of kali by clicking on Install Kali from Applications -> Usual Applications -> System Tools -> Install kali

Follow the installation guide until you get to network configuration. Make sure you configure and connect any of your network adapters

In my case I configured my wireless adapter because I didn't configure and share internet on my LAN connections

On getting to grub installation, it failed several times because of internet failure but i continued repeating the grub installation until it finished downloading all the grub packages

So, on concluding my installation, everything was perfect. My windows 7 installation was detected and booted Fine.