# forgot to emerge dhcpcd

## Alice_Alice

I made a mistake when I installed gentoo today. I forgot to emerge dhcpcd. 

After finished all installation, as expect, the network didn't work when reboot without CD. 

Now, I tried to use liveCD to boot up again and hope to emerge it. But I cannot connect to internet as soon as I 'chroot /mnt/gentoo /bin/bash'. If I returned to liveCD, the internet was okay. Is it strange? or is it the consequence of missing dhcpcd?

Can anybody help me on this problem? I hope there is a solution for my mistake. I do not want to re-install everything again. Many thanks! Please help.

----------

## pross

you have to copy resolv.conf from the livecd to the chroot for the network to work

----------

## John R. Graham

Correct. Alice_Alice, the whole process of rejoining a work-in-progress install is described in NeddySeagoons' Rough Guide to Chrooting.  :Smile: 

- John

----------

## Alice_Alice

Thanks! But it doesn't work for me.

My problem is when I used liveCD, I can connect to internet. When I chroot, the network didn't work.

I used wireless network. Below is what I did:

```

livecd / # nano -w /etc/conf.d/net

livecd / # nano -w /etc/wpa_supplicant/wpa_supplicant.conf

livecd init.d # ln -s net.lo net.wlan0

livecd init.d # /etc/init.d/net.wlan0 start

livecd init.d # ping www.google.com

PING www-g-com-chn.l.google.com (66.249.89.104) 56(84) bytes of data.

64 bytes from nrt04s01-inf104.1e100.net (66.249.89.104): icmp_req=1 ttl-52 time=60.0 ms

64 bytes from nrt04s01-inf104.1e100.net (66.249.89.104): icmp_req=2 ttl-52 time=60.0 ms

64 bytes from nrt04s01-inf104.1e100.net (66.249.89.104): icmp_req=3 ttl-52 time=60.0 ms

64 bytes from nrt04s01-inf104.1e100.net (66.249.89.104): icmp_req=4 ttl-52 time=60.0 ms

64 bytes from nrt04s01-inf104.1e100.net (66.249.89.104): icmp_req=5 ttl-52 time=60.0 ms

....

livecd init.d # chroot /mnt/gentoo /bin/bash

livecd / # env-update && source /etc/profile

>>>Regenerating /etc/ld.so.cache...

livecd / # export PS1="(chroot) $PS1"

(chroot) livecd / # ping -c 3 www.google.com

ping: unknown host www.google.com

```

Then I cannot emerge dhcpcd...

I also followed NeddySeagoons' Rough Guide to Chrooting, after env-updat && source /etc/profile, I typed:

```

(chroot) livecd / # /etc/init.d/net.wlan0 restart

 * Stopping wlan0

 *   Bringing down wlan0

 *       Shutting down wlan0 ...

 * Starting wlan0

 *   Configuration not set for wlan0 - assuming DHCP

 *   No DHCP client installed

```

Last edited by Alice_Alice on Wed Dec 08, 2010 6:13 am; edited 2 times in total

----------

## XQYZ

 *pross wrote:*   

> you have to copy resolv.conf from the livecd to the chroot for the network to work

 

Did you do that?

cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf

before chrooting.

----------

## Alice_Alice

 *Quote:*   

> Did you do that?
> 
> cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
> 
> before chrooting.

 

Yes, I did.[/quote]

----------

## XQYZ

Then I'm not sure what's the problem. So long as you have a connection on the live cd itself I'd just suggest to do an "emerge -fp dhcpcd" in the chrooted environment and then download the files on another shell using the URL(s) provided. Then just copy the files to /mnt/gentoo/usr/portage/distfiles and you should be good to go (ie emerge in the chroot). Hope this helps.

----------

## ocbMaurice

I also would say you have a problem with dns resolution.

IMO it will work if you try to to ping an IP directly inside the chroot:

```
chrooted# ping 66.249.89.104
```

You really should take a look at your resolv.conf and maybe nslookup.

It'll also work if you copy the necessary files for emerge to /usr/portage/distfiles to compile dhcp.

Maurice

----------

## Alice_Alice

I am not very familiar with the system so have to re-install everything.  :Crying or Very sad:  Thank you for all your help.

----------

## krinn

you know portage need the files to emerge a package, but it doesn't care from where they came from

so if you can have internet from livecd, mount your gentoo directory with the livecd and just download the needed file for dhcpcd

copy it to your distfiles directory and voilà !

no need to chroot or anything, now that your distfiles directory have the proper files to emerge dhcpcd, get back to your "normal" gentoo and re-emerge dhcpcd, this time portage won't try to connect to grab the files and will use the ones in distfiles

problem solve, no battle with chrooting or level of familiarity with the system, you need to know how to use mount+wget+cp commands

----------

## Alice_Alice

 *krinn wrote:*   

> you know portage need the files to emerge a package, but it doesn't care from where they came from
> 
> so if you can have internet from livecd, mount your gentoo directory with the livecd and just download the needed file for dhcpcd
> 
> copy it to your distfiles directory and voilà !
> ...

 

 This is a new trick for me. Thank Krinn very much!

----------

