I have just installed Ubuntu Server 18.04 and set up SSH so I can continue configuring via my desktop but I've run into some issues that I can't seem to get past.

I was trying to run

sudo apt-get update

but was constantly getting the errors:

Temporary failure resolving archive.ubuntu.com

Failed to fetch http://archive.ubuntu........

I checked to see if my internet connection was ok by running


and I got a response, all ok there.

I suspected that maybe my DNS was not set-up correctly so I tried

ping www.google.com

and got the error:

Temporary failure in name resolution

Ok, so I had determined that it is, in fact, some sort of DNS issue, but all the “answers” I've tried have not worked for me.

I've tried editing /etc/resolv.conf without luck as it appears to be a symbolic link.

I found an answer here which only works if I run from root, ie:

sudo bash

But it instructs to reverse the changes afterwards by:

rm /etc/resolv.conf
ln -s /run/resolvconf/resolv.conf /etc/resolv.conf

If I do that though, I lose connection again.

  • Should I just leave it the way I had it or something else?
  • Can this be a permanent solution?
  • And is the cause of the problem the fact that /run/resolvconf/resolv.conf doesn't actually exist?
  • Well, if /run/resolvconf/resolv.conf doesn't exist there is no point in creating a symlink from /etc/resolv.conf to it. So until you found out why that file doesn't exist I would recommend to use your working, manual resolv.conf. Can you add the output of dpkg -l resolvconf to your question? Jun 10 '18 at 12:15
  • Did you configure netplan to use your chosen DNS client, as described here? Name Resolution Jun 10 '18 at 12:16
  • 1
    The resolvconf program doesn't appear to be installed; if I type 'dpkg -l resolvconf' I get 'un resolvconf <none> <none> (no description available)
    – coxe87b
    Jun 11 '18 at 12:53
  • Yes, I tried configuring netplan with DNS to no avail
    – coxe87b
    Jun 11 '18 at 12:56
  • 1
    This resolved this error for me. ycsoftware.net/…
    – user946871
    Apr 20 '19 at 15:24

In ubuntu server 18-04, with xorg lightdm lightdm-gtk-greeter and xfce4 GUI installed, when booting into the system, the only way I figured out to get the wired network going is this:

    sudo dhclient -v -4

works great, however, this has to be done manually after every boot and after every network disconnect/reconnect, so it works but it is a manual solution, not the permanent solution;

to get the wireless network going automatically, simply:

    sudo apt-get install nm-tray network-manager

you probably have to reboot; then you will be able to use the wireless network icon that appears in the notification area in your control panel (make sure the notification area is added to the panel) to select a wireless network; after that, it will reconnect automatically;

however, to get the wired network to reconnect automatically, I tried installing avahi-daemon and avahi-autoipd but apparently, it is not helping; even tried:

    sudo systemctl start NetworkManager
    sudo systemctl enable NetworkManager

basically, if you install a distro such as Xubuntu desktop, the proper tool(s)/daemon/config is installed and the network is detected automatically when it is plugged in without any user configuration; would be nice to know which tool/daemon/config/setting does that.


18.04 release change the resolv.conf to netplan


man netplan

dir location /etc/netplan inside you will find file eg.: 50-cloud-init.yaml

edit it like this:

            dhcp4: false
                - domain.local
    version: 2

when you save file do

sudo netplan apply

and check if u can ping google.com.


I got this error when I was a debootstrap QEMU image.

The resolution required the following:

  1. make the root filesystem rw, or elsedhclient fails. The better way to do this is to add to your /etc/fstab, which is just a dummy in debootstrap:

    /dev/sda / ext4 errors=remount-ro,acl 0 1
    • On Ubuntu 18.04, you can do either of the following:

      1. Create a systemd unit that initializes networking at the right time:

        cat << EOF | sudo tee "/etc/systemd/system/dhclient.service"
        Description=DHCP Client
        ExecStart=/sbin/dhclient -4 -q
        sudo ln -sf "/etc/systemd/system/dhclient.service" \

      Based on: https://gist.github.com/corvax19/6230283#gistcomment-1940694

      1. Use network-manager. Downloads a lot of graphical libraries, but feels less hacky:

        sudo apt-get install network-manager
        cat << EOF | sudo tee "/etc/netplan/01-network-manager-all.yaml"
        # Let NetworkManager manage all devices on this system
          version: 2
          renderer: NetworkManager

        I found this by first looking at the first network config file I knew from Debian from my host:

        cat /etc/network/interfaces

        but awesome Ubuntu devs left a message there:

         # ifupdown has been replaced by netplan(5) on this system.  See
         # /etc/netplan for current configuration.
         # To re-enable ifupdown on this system, you can run:
         #    sudo apt install ifupdown

        so I did a:

        cat /etc/network/interfaces

        on my Ubuntu host and found the missing config.

      Full Ubuntu debootstrap setup at: Is there any prebuilt QEMU Ubuntu image(32bit) online?

    • On Debian 9, add the correct entry to your /etc/network/interfaces config file. Mine was:

      auto enp0s3
      iface enp0s3 inet dhcp

      and eth0 instead of enp0s3 is another common value, you can find it out with:

      ip link show

      Full Debian debootstrap setup at https://unix.stackexchange.com/questions/275429/creating-bootable-debian-image-with-debootstrap/473256#473256


I had the same name resolution issue after upgrading to Ubuntu 18.04 LTS.


Upgrading the system had wiped the DNS name server settings that were previously in /etc/resolv.conf


Edit /etc/resolvconf/resolv.conf.d/base and add the name server details

nano /etc/resolvconf/resolv.conf.d/base

Add the IP address of your DNS name server for your network or ISP in this format:


(Replace the ip address with your DNS name server. )

To have the changes take effect immediately run:

sudo resolvconf -u

The last line lets you skip rebooting. Alternatively you can also edit /etc/resolv.conf and make the exact same changes (but this file will be rewritten on reboot).

Don't know your DNS name server?

Go to a windows machine on the same network, and from the command prompt type

ipconfig /all

If you have several devices then each device should have a DNS name server listed and you will want to pick accordingly. The DNS server info will look like this :

DNS Servers . . . . . . . . . . . :

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.