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?




6 Answers 6


Do you normally get your IP address from DHCP server ?

$ ifconfig eth0 up 
$ sudo dhclient eth0

To set IP address you want (for example type:

ifconfig eth0 netmask 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> Jun 7, 2009 at 15:31
  • +1 Still works on 12.04. PS: you don't need sudo in recovery mode.
    – l0b0
    Feb 1, 2013 at 20:16
  • Formatting @MattSimmons ' comment for n00bs like me: route add default gw <gateway-ip> Aug 26, 2019 at 0:23
  • just adapter-name, to be specific to your environment. e.g. eth0, would be enp0s3 (default) in my case, when running on virtual machine. (+1)
    – parasrish
    Mar 11, 2020 at 3:54

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


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
  • 1
    This is much more useful than the accepted answer if you have newer version of Ubuntu that doesn't come with net-tools for ifconfig. +1
    – GPPK
    Aug 7, 2021 at 11:00

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).


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
  • this is what worked for me on ubuntu 18.04
    – brad
    Jun 11, 2020 at 14:45
  • worked for me, ubuntu 20.04
    – Maxxik CZ
    Jan 31, 2021 at 11:35
  • This fixed my networking issue from terminal on ubuntu 22.04 LTS ..
    – Gautam
    Sep 3 at 5:44

You can go back to the recovery menu options by login-out (cntrl + D), then select the option "Network ------- Enable networking" and Ubuntu will do the rest for you to activate networking. You will be brought back to this menu screen, so you can get back to the shell prompt and continue whatever you were trying to fix.


Just start the network manager in recovery mode

systemctl start network-manager

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .