first update your system

sudo pacman -Syu 

Reboot your system

next install the required tools

sudo pacman -Syu manjaro-tools-iso manjaro-iso-profiles-official

Edit the Packages-Desktop file

sudo nano /usr/share/manjaro-tools/iso-profiles/official/xfce/Packages-Desktop
## Php server

Compile the iso

 buildiso -p xfce

Select yes and wait

Clean your system

sudo rm -r /var/lib/manjaro-tools/buildiso/
paccache -ruk0



Install the required tools

sudo apt-get install squashfs-tools syslinux-utils

Download the ubuntu iso


Setup iso_file variable

export iso_file=ubuntu-18.10-desktop-amd64.iso

Extract the image and mount it

mkdir mnt
sudo mount -o loop ${iso_file} mnt/

Extract the filesystem.squashfs

mkdir extract-cd
sudo rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
mkdir squashfs
sudo unsquashfs mnt/casper/filesystem.squashfs
sudo mv squashfs-root edit

Bind the enviroment and chroot into it

sudo mount --bind /dev/ edit/dev
sudo chroot edit
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
export HOME=/root
export LC_ALL=C

Edit the dns config

nano /run/systemd/resolve/stub-resolv.conf

Install php and apache

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install php

Install finnish and spanish

apt-get remove --purge language-pack-bn language-pack-bn-base language-pack-gnome-bn language-pack-gnome-bn-base language-pack-es language-pack-es-base language-pack-gnome-es language-pack-gnome-es-base language-pack-pt language-pack-pt-base language-pack-gnome-pt language-pack-gnome-pt-base language-pack-xh language-pack-xh-base language-pack-gnome-xh language-pack-gnome-xh-base language-pack-hi language-pack-hi-base language-pack-gnome-hi language-pack-gnome-hi-base language-pack-de language-pack-de-base language-pack-fr language-pack-fr-base language-pack-gnome-de language-pack-gnome-de-base language-pack-gnome-fr language-pack-gnome-fr-base firefox-locale-bn firefox-locale-de firefox-locale-es firefox-locale-pt language-pack-gnome-zh-hans language-pack-gnome-zh-hans-base language-pack-zh-hans language-pack-zh-hans-base firefox-locale-zh-hans
sed -i 's/restricted/restricted universe/' /etc/apt/sources.list
apt update
apt install gnome-getting-started-docs-fi gnome-user-docs-fi language-pack-fi language-pack-fi-base language-pack-gnome-fi language-pack-gnome-fi-base
gnome-getting-started-docs-es gnome-user-docs-es language-pack-es language-pack-es-base language-pack-gnome-es language-pack-gnome-es-base 
apt install xul-ext-mozvoikko libreoffice-l10n-fi libreoffice-voikko firefox-locale-fi libreoffice-help-fi thunderbird-locale-fi libenchant-voikko tmispell-voikko
libreoffice-l10n-es  firefox-locale-es libreoffice-help-es thunderbird-locale-es
sed -i 's/restricted universe/restricted/' /etc/apt/sources.list
apt install libreoffice-l10n-en-gb libreoffice-help-en-gb libreoffice-l10n-en-za libreoffice-help-en-us poppler-data hyphen-fi hunspell-en-ca mythes-en-au thunderbird-locale-en-gb hyphen-en-us thunderbird-locale-en-us mythes-en-us wbritish hunspell-en-za libreoffice-l10n-en-gb hunspell-en-gb

Open a new terminal to configure ubuntu preseed

sudo su
cd extract-cd 
cd preseed
nano ubuntu.seed

Ubuntu.seed contents

# Enable
d-i apt-setup/extras    boolean true
# Install the Ubuntu desktop.
tasksel tasksel/first   multiselect ubuntu-desktop
# On live DVDs, don't spend huge amounts of time removing substantial
# application packages pulled in by language packs. Given that we clearly
# have the space to include them on the DVD, they're useful and we might as
# well keep them installed.
ubiquity    ubiquity/keep-installed string icedtea6-plugin php

Go back to the first terminal and clean up the system

apt clean
rm -rf /tmp/*
rm -rf /var/cache/apt-xapian-index/*
rm -rf /var/lib/apt/lists/*
umount /proc
umount /sys
umount /dev/pts

Exit the enviroment

sudo umount edit/dev

Create the file manifest

sudo -s
chmod +w extract-cd/casper/filesystem.manifest
chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest

Create the filesystem.squashfs

mksquashfs edit extract-cd/casper/filesystem.squashfs

Export the iso file

export output_file=ubuntu-18.04-desktop-apache-remix-amd64.iso

export IMAGE_NAME="Ubuntu 18.10"
sed -i -e "s/$IMAGE_NAME/$IMAGE_NAME (Apache Remix)/" extract-cd/README.diskdefines
sed -i -e "s/$IMAGE_NAME/$IMAGE_NAME (Apache Remix)/" extract-cd/.disk/info
cd extract-cd
rm -f md5sum.txt
(find -type f -print0 | xargs -0 md5sum | grep -v isolinux/ | sudo tee ../md5sum.txt)
mv -f ../md5sum.txt ./
# If the following is not done, causes an error in the boot menu disk check option
sed -i -e '/isolinux/d' md5sum.txt
export IMAGE_NAME="Ubuntu 18.04 apache-remix amd64"
genisoimage -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/ -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -o ../${output_file} .
cd ..
isohybrid --uefi ${output_file}
umount squashfs/
umount mnt/

Now you have your own customized ubuntu image with anything you want to preinstall
Here's the iso files i created for this tutorial
[wbcr_php_snippet id="56"]



Download and configure linux kernel

install compilation tools on a ubuntu distro 18.04 (linux mint,xubuntu)

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install fakeroot build-essential ncurses-dev xz-utils libssl-dev bc bison flex
 sudo apt-get install kernel-package

now download linux kernel in this tutorial 4.18.16 it might not be the latest


untar the kernel

tar -xvf linux-4.18.16.tar.xz

go to the directory and copy the current config from your current kernel look carefully at what to enable in make oldconfig

 cp -v /boot/config-$(uname -r) .config
 make oldconfig

Warning do not do this if you’re not familiar with Linux. If you want to customize your kernel more you can run make menuconfig or install kernel patches (example ssd patch)

Compile the kernel you can compile using fakeroot

fakeroot make-kpkg --initrd  kernel_image kernel_headers -j 16

installing the kernel

cd ..
sudo apt install ./linux*.4.18.16*.deb

now reboot your system

  sudo reboot