You can use Fenix (one-stop script set) to build Ubuntu/Debian images.
Clone Fenix repo to somewhere like:
$ mkdir ~/project/
You should setup the build environment first.For example board type, linux version, distribution, etc.
$ cd ~/project/fenix
You will get result like this:
nick@Nick:~/project/khadas/ubuntu$ source env/setenv.sh
Choose Khadas board:
Which board would you like?  1
Choose uboot version:
Which uboot version would you like? 
Choose linux version:
Which linux version would you like? 
Which distribution would you like? 
Choose Ubuntu release:
Which Ubuntu release would you like? 
Choose Ubuntu type:
Which Ubuntu type would you like? 
Choose Ubuntu architecture:
Which Ubuntu architecture would you like? 
Choose install type:
Which install type would you like? 
Environment setup done.
Type 'make' to build.
If you have setup the environment then it’s time to build the image.
And Fenix requires root privileges, you need to enter your password.
NOTE:If it’s your first time to build, the script will check your host PC environment
and install some essential packages, and some repos(u-boot,linux) will be cloned
automatically from Khadas GitHub.
You can get help messags by executing
$ make help
Fenix scripts help messages:
all - Create image according to environment.
kernel - Build linux kernel.
uboot - Build u-boot.
debs - Build linux debs.
image - Pack update image.
clean - Cleanup.
info - Display current environment.
Build linux kernel only.
Build u-boot only.
Build linux deb packages.
Display current environment.