If port 53 is in use, the installation fails. This issue can occur in default installations of certain operating systems in which systemd-resolved (DNS server) or dnsmasq is running.

To prevent this issue, change the system configuration to make this port available before installation.

To prevent systemd-resolved from using port 53:

  1. Edit /etc/systemd/resolved.conf:

    sudo vi /etc/systemd/resolved.conf
    
  2. Add DNSStubListener=no as the last line in the file and save the file.

  3. Rename the current /etc/resolv.conf file:

    sudo mv /etc/resolv.conf /etc/resolv.conf.orig
    
  4. Create a symbolic link for /etc/resolv.conf:

    sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
    
    Note:
    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 restart systemd-resolved in the next step.
  5. Restart the DNS service:

    sudo service systemd-resolved restart
    

To prevent dnsmasq from using port 53:

  1. Stop the dnsmasq service if it's running:

    sudo systemctl stop dnsmasq
    
  2. Prevent dnsmasq from starting automatically at system boot:

    sudo systemctl disable dnsmasq
    
  3. Mask dnsmasq to prevent it from being started manually or by other services:

    sudo systemctl mask dnsmasq
    
  4. Verify dnsmasq is no longer active and won't start at system boot:

    sudo systemctl status dnsmasq