/usr/bin/wg-quick: line 31: resolvconf: command not found [WireGuard | Debian]

Error Message:

/usr/bin/wg-quick: line 31: resolvconf: command not found

The issue:

I am not fully certain, I do have openresolv installed rn and have tried it and got the same response when resolvconf is installed.

Either way, I cannot connect to my VPN.


Solution 1:

Modern Linux distributions use systemd, which comes with its own flavor of resolvconf as part of the resolvectl command. See manpage. A symlink called resolvconf can be created somewhere in $PATH.

  • On Arch linux there's the systemd-resolvconf package that does this for you.
  • On Debian (and Ubuntu?) you must do this manually. Using /usr/local to prevent possible package conflicts:
    ln -s /usr/bin/resolvectl /usr/local/bin/resolvconf
    

With the symlink in place, wg-quick works fine for me.

Edit: There is a Debian bug report requesting the symlink

Solution 2:

Had the same problem, found on this page: https://github.com/StreisandEffect/streisand/issues/1434

sudo apt install openresolv

Resolved it for me.

Solution 3:

Try using systemctl instead:

systemctl start wg-quick@<vpn-name>

Or if you wish to start the VPN every time you start your machine use:

systemctl enable wg-quick@<vpn-name>

Solution 4:

It’s not the solution, but if you comment out the DNS in the wg0 conf file it will work. wg-quick does a bunch of things behind the scenes, one of them is adjusting the nameserver, typically to use your vpn providers. Set your /etc/resolv.conf to use Cloudflare (1.1.1.1), then try again. It should connect without the resolvconf dependency.