如果端口 53 正在使用中,则安装失败。在某些作系统的默认安装中,可能会出现此问题,其中systemd-resolved(DNS 服务器) 正在运行。

要防止出现此问题,请在安装前更改系统配置以使此端口可用。

  1. 编辑/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