If port 53 is in use, the installation fails. This can occur in
default installations of Ubuntu 18.04 and 20.04 in which systemd-resolved (DNS server) is running.
To prevent this issue, change the system configuration to make this port available before installation.
Edit
/etc/systemd/resolved.conf:sudo vi /etc/systemd/resolved.confAdd
DNSStubListener=noas the last line in the file and save the file.Rename the current
/etc/resolv.conffile:sudo mv /etc/resolv.conf /etc/resolv.conf.origCreate a symbolic link for
/etc/resolv.conf:sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.confNote:You might encounter a temporary name resolution error (sudo: unable to resolve host {hostname}: Temporary failure in name resolution), which should be fixed when you restartsystemd-resolvedin the next step.Restart the DNS service:
sudo service systemd-resolved restart