This issue is caused while using the Wireguard in Ubuntu as the installation doesn't come with resolvconf or openresolv
Problem
sid@sid:~$ sudo wg-quick up /etc/wireguard/abc.conf
[sudo] password for sid:
[#] ip link add abc type wireguard
[#] wg setconf abc /dev/fd/63
[#] ip -4 address add 10.2.0.2/32 dev abc
[#] ip link set mtu 1420 up dev abc
[#] resolvconf -a abc -m 0 -x
/usr/bin/wg-quick: line 32: resolvconf: command not found
[#] ip link delete dev abc
sid@sid:~$
To solve this we need to install resolvconf or openresolv
sudo apt install openresolv
sudo apt install resolvconf
sid@sid:~$ sudo nala install openresolv
================================================================================
Installing
================================================================================
Package: Version: Size:
openresolv 3.12.0-2 26 KB
================================================================================
Summary
================================================================================
Install 1 Packages
Total download size 26 KB
Disk space required 105 KB
Do you want to continue? [Y/n] Y
╭─ Downloading… ───────────────────────────────────────────────────────────────╮
│ Total Packages: 1/1 │
│ Last Completed: openresolv_3.12.0-2_all.deb │
│ Time Remaining: 0:00:00 ━━━━━━━━━━━━━━━━━━ 100.0% • 25.6/25.6 KB • 70.7 KB/s │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Installing Packages ────────────────────────────────────────────────────────╮
│Unpacking: openresolv (3.12.0-2) │
│Setting up: openresolv (3.12.0-2) │
│Processing: triggers for man-db (2.10.2-1) │
│╭────────────────────────────────────────────────────────────────────────────╮│
││✔ Running dpkg … ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 0:00:00 • 3/3││
│╰────────────────────────────────────────────────────────────────────────────╯│
╰──────────────────────────────────────────────────────────────────────────────╯
Finished Successfully
sid@sid:~$ sudo wg-quick up /etc/wireguard/abc.conf
[#] ip link add abc type wireguard
[#] wg setconf abc /dev/fd/63
[#] ip -4 address add 10.2.0.2/32 dev abc
[#] ip link set mtu 1420 up dev abc
[#] resolvconf -a abc -m 0 -x
[#] wg set abc fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev abc table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
[#] sysctl -q net.ipv4.conf.all.src_valid_mark=1
[#] nft -f /dev/fd/63
sid@sid:~$
it works! Thanks