29

I tried to upgrade Ubuntu from Hardy to Intrepid last night, and seem to have killed it.

I can boot into "recovery mode" and the root shell, but it freezes when it tries to start the Gnome environment etc.

In this recovery mode it doesn't seem to be on the network (ie. ifconfig shows the lo bit but not the eth0 bit) And I can't ping or ssh to it.

How can I start networking from this prompt?

cheers

phil

29

Do you normally get your IP address from DHCP server ?

$ ifconfig eth0 up 
$ sudo dhclient eth0

To set IP address you want (for example 192.168.0.1) type:

ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up
route add default gw GATEWAY-IP eth0

If you have a problem with gdm during the boot, switch to the real console:

Use the Ctrl-Alt-F1 shortcut keys to switch to the first console.

To switch back to Desktop mode (gdm), use the Ctrl-Alt-F7 shortcut keys.

  • 2
    Don't forget to add your default gateway (if you want internet access): route add default gw <gateway-ip> – Matt Simmons Jun 7 '09 at 15:31
  • +1 Still works on 12.04. PS: you don't need sudo in recovery mode. – l0b0 Feb 1 '13 at 20:16
  • Formatting @MattSimmons ' comment for n00bs like me: route add default gw <gateway-ip> – frank Aug 26 at 0:23
6

To start networking, /etc/init.d/networking start should do the trick. I'd say that if Gnome isn't starting, you've got X config problems. If you disable gdm from starting on boot, then you should be able to get to a regular console prompt and do diagnosis from there (check /var/log/Xorg.0.log and so on).

0

Step by step with ip

  1. Get the name of the network interface with the ip link command. The name may differ with motherboards. It should be different from lo, the virtual local interface.
# ip link
  1. Assuming the network interface is called eth0, the following command will bring the interface up. This should now be visible when executing the command ip link once more.
# ip link set eth0 up
# ip link
  1. Next, a local IP address needs to be obtained from the router. The second command is again for checking.
# dhclient eth0
# ip addr show dev eth0
  1. Finally, a temporary domain name server (DNS) is required to translate URLs to IP addresses. This can be either the router in the LAN (if previously/automatically properly configured), the DNS of the ISP or —if you still trust them— Google's DNS at 8.8.8.8 This requires editing a system configuration file that normally should not be edited. However, any changes made will automatically disappear when rebooting.
# nano /etc/resolv.conf

Add a line containing, for example:

nameserver 192.168.178.1

Some more helpful commands

Personally, I ended up in this dire situation by replacing an NVidia video card with a much older model. Once the networking established, the following set of commands allowed me to successfully install the proper NVidia card driver.

# update-drivers autoinstall
# update-initramfs -k all -u
# update-grub
0

In newer versions of Ubuntu name resolution does not work via /etc/resolv.conf anymore. Thus you need to do something like

dhclient eno1
systemctl start systemd-resolved

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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