Installation problem on Ubuntu

Been trying to install for a week with no success. I am using Ubuntu 20.04 on Windows 10. My linux kernel is 5.10.16.3-microsoft-standard-WSL2. When I tried to use the makefile it complains that there are no linux headers for this kernel. What should I do? I’m not sure how to uninstall this WSL2 kernel and install a different version.

Also when I tried to follow this post (Free5GC Install problem - #4 by whiddett) I got the message “Unable to locate package linux-image-5.0.0-23-generic”.

I tried installing versions above 5.4 but even after that the uname -r command still says my version is the microsoft-standard-WSL2. And when I use the reboot command it said “System has not been booted with systemd as init system (PID 1). Can’t operate. Failed to connect to bus: Host is down.”

Please help me I have been stuck for days trying to figure this out.

Hi hgao,
For free5GC environment, you should use Ubuntu 18.04 and linux kernel 5.0.0-23-generic(Environment · free5gc/free5gc Wiki · GitHub).
In Ubuntu 18.04, you may try these instructions:
sudo apt-get update
sudo apt-get install linux-image-5.0.0-23-generic
sudo apt install linux-headers-5.0.0-23-generic
and reboot it.
Check version by uname -r.