View previous topic :: View next topic |
Author |
Message |
Alice_Alice n00b
Joined: 15 May 2006 Posts: 55 Location: Hong Kong
|
Posted: Tue Dec 07, 2010 4:03 pm Post subject: forgot to emerge dhcpcd |
|
|
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 |
|
|
pross Apprentice
Joined: 30 Jul 2003 Posts: 156 Location: Ireland
|
Posted: Tue Dec 07, 2010 4:07 pm Post subject: |
|
|
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 |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10587 Location: Somewhere over Atlanta, Georgia
|
Posted: Tue Dec 07, 2010 4:38 pm Post subject: |
|
|
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 |
|
|
Alice_Alice n00b
Joined: 15 May 2006 Posts: 55 Location: Hong Kong
|
Posted: Wed Dec 08, 2010 5:52 am Post subject: |
|
|
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 |
|
|
XQYZ Apprentice
Joined: 19 Jul 2009 Posts: 231 Location: Europe
|
Posted: Wed Dec 08, 2010 5:55 am Post subject: |
|
|
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 |
|
|
Alice_Alice n00b
Joined: 15 May 2006 Posts: 55 Location: Hong Kong
|
Posted: Wed Dec 08, 2010 6:11 am Post subject: |
|
|
Quote: | Did you do that?
cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
before chrooting. |
Yes, I did.[/quote] |
|
Back to top |
|
|
XQYZ Apprentice
Joined: 19 Jul 2009 Posts: 231 Location: Europe
|
Posted: Wed Dec 08, 2010 7:59 am Post subject: |
|
|
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 |
|
|
ocbMaurice Tux's lil' helper
Joined: 14 Feb 2003 Posts: 90 Location: Switzerland
|
Posted: Thu Dec 09, 2010 1:18 pm Post subject: |
|
|
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 |
|
|
Alice_Alice n00b
Joined: 15 May 2006 Posts: 55 Location: Hong Kong
|
Posted: Sat Dec 11, 2010 1:15 am Post subject: |
|
|
I am not very familiar with the system so have to re-install everything. Thank you for all your help. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Sat Dec 11, 2010 8:23 am Post subject: |
|
|
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 |
|
|
Alice_Alice n00b
Joined: 15 May 2006 Posts: 55 Location: Hong Kong
|
Posted: Sun Dec 12, 2010 3:24 am Post subject: |
|
|
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 |
|
|
|