========================
First I recommend checking the official LineageOS wiki instructions for building for dubai here to see what are the dependencies and how to install them https://wiki.lineageos.org/devices/dubai/build
Also please note that repopick.sh isn't always updated. Please check LineageOS Gerrit in case there is changes to repopick topics.
# cd into your ROM's folder (IE, from scratch I would mkdir -p ~/android/lineage-22.1 && cd ~/android/lineage-22.1)
repo init -u https://github.com/LineageOS/android.git -b lineage-22.1 --git-lfs
mkdir -p .repo/local_manifests
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/extras.xml > .repo/local_manifests/extras.xml
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/motorola-common.xml > .repo/local_manifests/motorola-common.xml
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/motorola-sm7325.xml > .repo/local_manifests/motorola-sm7325.xml
repo sync
# cd into your ROM's folder
mkdir -p .repo/local_manifests
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/extras.xml > .repo/local_manifests/extras.xml
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/motorola-common.xml > .repo/local_manifests/motorola-common.xml
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/motorola-sm7325.xml > .repo/local_manifests/motorola-sm7325.xml
repo sync
# cd into your ROM's folder
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/berlin_clean_build.sh > berlin_clean_build.sh
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/berlin_dirty_build.sh > berlin_dirty_build.sh
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/berlna_clean_build.sh > berlna_clean_build.sh
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/berlna_dirty_build.sh > berlna_dirty_build.sh
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/dubai_clean_build.sh > dubai_clean_build.sh
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/dubai_dirty_build.sh > dubai_dirty_build.sh
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/tundra_clean_build.sh > tundra_clean_build.sh
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/tundra_dirty_build.sh > tundra_dirty_build.sh
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/xpeng_clean_build.sh > xpeng_clean_build.sh
curl https://raw.githubusercontent.com/moto-sm7325/local_manifests/lineage-22.1/xpeng_dirty_build.sh > xpeng_dirty_build.sh
./berlin_clean_build.sh // for berlin clean builds
./berlin_dirty_build.sh // for berlin dirty builds
./berlna_clean_build.sh // for berlna clean builds
./berlna_dirty_build.sh // for berlna dirty builds
./dubai_clean_build.sh // for dubai clean builds
./dubai_dirty_build.sh // for dubai dirty builds
./tundra_clean_build.sh // for tundra clean builds
./tundra_dirty_build.sh // for tundra dirty builds
./xpeng_clean_build.sh // for xpeng clean builds
./xpeng_dirty_build.sh // for xpeng dirty builds
I made these modified scripts for convenience plus logs terminal output to files for easy scrolling later in your favorite text editor.