Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
forgot to emerge dhcpcd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Alice_Alice
n00b
n00b


Joined: 15 May 2006
Posts: 55
Location: Hong Kong

PostPosted: Tue Dec 07, 2010 4:03 pm    Post subject: forgot to emerge dhcpcd Reply with quote

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.
Back to top
View user's profile Send private message
pross
Apprentice
Apprentice


Joined: 30 Jul 2003
Posts: 156
Location: Ireland

PostPosted: Tue Dec 07, 2010 4:07 pm    Post subject: Reply with quote

you have to copy resolv.conf from the livecd to the chroot for the network to work
_________________
My Overlay [pross] | bfs-sources
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Dec 07, 2010 4:38 pm    Post subject: Reply with quote

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

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Alice_Alice
n00b
n00b


Joined: 15 May 2006
Posts: 55
Location: Hong Kong

PostPosted: Wed Dec 08, 2010 5:52 am    Post subject: Reply with quote

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:
Code:

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:
Code:

(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
Back to top
View user's profile Send private message
XQYZ
Apprentice
Apprentice


Joined: 19 Jul 2009
Posts: 231
Location: Europe

PostPosted: Wed Dec 08, 2010 5:55 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Alice_Alice
n00b
n00b


Joined: 15 May 2006
Posts: 55
Location: Hong Kong

PostPosted: Wed Dec 08, 2010 6:11 am    Post subject: Reply with quote

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


Yes, I did.[/quote]
Back to top
View user's profile Send private message
XQYZ
Apprentice
Apprentice


Joined: 19 Jul 2009
Posts: 231
Location: Europe

PostPosted: Wed Dec 08, 2010 7:59 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
ocbMaurice
Tux's lil' helper
Tux's lil' helper


Joined: 14 Feb 2003
Posts: 90
Location: Switzerland

PostPosted: Thu Dec 09, 2010 1:18 pm    Post subject: Reply with quote

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:
Code:
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
Back to top
View user's profile Send private message
Alice_Alice
n00b
n00b


Joined: 15 May 2006
Posts: 55
Location: Hong Kong

PostPosted: Sat Dec 11, 2010 1:15 am    Post subject: Reply with quote

I am not very familiar with the system so have to re-install everything. :cry: Thank you for all your help.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sat Dec 11, 2010 8:23 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Alice_Alice
n00b
n00b


Joined: 15 May 2006
Posts: 55
Location: Hong Kong

PostPosted: Sun Dec 12, 2010 3:24 am    Post subject: Reply with quote

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à !

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


This is a new trick for me. Thank Krinn very much!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum