Can't install wireguard

Hello,

I cannot make wireguard to install on my rock pi 4b running ubuntu 20.04
I have followed the instructions on similar topics but no luck.

    root@rockpi4b:~# cd /usr/src/linux-headers-$(uname -r)
root@rockpi4b:/usr/src/linux-headers-4.4.154-113-rockchip-gdb9dfc2cdd25# make script
s
  CHK     scripts/mod/devicetable-offsets.h
root@rockpi4b:/usr/src/linux-headers-4.4.154-113-rockchip-gdb9dfc2cdd25# apt-get install wireguard
Reading package lists... Done
Building dependency tree
Reading state information... Done
wireguard is already the newest version (1.0.20200513-1~20.04.2).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up wireguard-dkms (1.0.20201112-1~20.04.1) ...
Removing old wireguard-1.0.20201112 DKMS files...

------------------------------
Deleting module version: 1.0.20201112
completely from the DKMS tree.
------------------------------
Done.
Loading new wireguard-1.0.20201112 DKMS files...
Building for 4.4.154-113-rockchip-gdb9dfc2cdd25
Building initial module for 4.4.154-113-rockchip-gdb9dfc2cdd25
Error! Bad return status for module build on kernel: 4.4.154-113-rockchip-gdb9dfc2cdd25 (aarch64)
Consult /var/lib/dkms/wireguard/1.0.20201112/build/make.log for more information.
dpkg: error processing package wireguard-dkms (--configure):
 installed wireguard-dkms package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of wireguard:
 wireguard depends on wireguard-dkms (>= 0.0.20200121-2) | wireguard-modules (>= 0.0.20191219); however:
  Package wireguard-dkms is not configured yet.
  Package wireguard-modules is not installed.

dpkg: error processing package wireguard (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 wireguard-dkms
 wireguard
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any clue? I have followed any related instruction i could find on the forum but still not working

Same problem

Reading package lists... Done
Building dependency tree
Reading state information... Done
rockchip-overlay is already the newest version (3.0).
The following package was automatically installed and is no longer required:
  libopts25
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up wireguard-dkms (1.0.20201112-1~20.04.1) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Removing old wireguard-1.0.20201112 DKMS files...

------------------------------
Deleting module version: 1.0.20201112
completely from the DKMS tree.
------------------------------
Done.
Loading new wireguard-1.0.20201112 DKMS files...
Building for 4.4.154-116-rockchip-g86a614bc15b3
Building initial module for 4.4.154-116-rockchip-g86a614bc15b3
Error! Bad return status for module build on kernel: 4.4.154-116-rockchip-g86a614bc15b3 (aarch64)
Consult /var/lib/dkms/wireguard/1.0.20201112/build/make.log for more information.
dpkg: error processing package wireguard-dkms (--configure):
 installed wireguard-dkms package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of wireguard:
 wireguard depends on wireguard-dkms (>= 0.0.20200121-2) | wireguard-modules (>= 0.0.20191219); however:
  Package wireguard-dkms is not configured yet.
  Package wireguard-modules is not installed.

dpkg: error processing package wireguard (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 wireguard-dkms
 wireguard
E: Sub-process /usr/bin/dpkg returned an error code (1)
rock@rockpi4b:~$ uname -a
Linux rockpi4b 4.4.154-116-rockchip-g86a614bc15b3 #1 SMP Mon Jan 10 12:03:08 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
rock@rockpi4b:~$

Did anybody solve this, I am having similar issue too.

Are you able to compile any modules against the headers?

Hi, I am using the Debian image.

I did the following

sudo su
apt-get install -y libssl-dev build-essential  
cd /usr/src/linux-headers-$(uname -r)
make scripts

Which threw a pyhton error so I installed python and re ean and seemed ok installing wireguard. I then tried ot ocnfigure an interface and got the error Unable to access interface: Protocol not supported

At thatpoint I rebooted and the board wont boot, nothing on HDMI so will need re-flashed I guess. Not really sure where ot go form here, wireguard is a solid requirement for this project.

Is the Radxa team patching the headers, because that won’t work other wise.
If not, install the needed depends: (if python is needed install that too)
sudo apt install -y make build-essential bc kmod cpio flex libncurses5-dev libelf-dev libssl-dev

and…

cd /usr/src/linux-headers-$(uname -r)
sudo wget -cq https://raw.githubusercontent.com/pyavitz/debian-image-builder/feature/patches/packaging/headers-byteshift.patch
sudo make M=scripts clean
sudo patch -p1 < headers-byteshift.patch
sudo make -j6 -s scripts
sudo make -j6 -s M=scripts/mod/
sudo rm -f headers-byteshift.patch

If its pre-patched, skip the download and patching bit.

In my opinion, this should be done using the builddeb during compilation of the kernel and deb creation process.

NOTE: Do this at ur own risk, I’m not using that kernel. But this is exactly “although less complicated than” what the packaging patch I use does.

I managed to install wireguard in docker container but it started crashing my rockpi.
Now the problem is that I removed that container but rockpi is still crashing every couple hours.

i think you need to install dialog.
(No usable dialog-like program is installed)

sudo apt install dialog

i could be wrong ,