The correct and long answer is in the wiki:
https://help.ubuntu.com/community/InstallCDCustomization#Modify_pool_structure_to_include_more_packages
But I've done it in the wrong hacky way without signing and with manual activation (which is enough for me):
- Marked all needed packages for (re)installation in Synaptic and used
File > Generate download script
- Launched that script to download all the packages.
- Unpacked the Alternate CD iso with UCK to
/home/username/tmp/remaster-iso (default location). It stopped on trying to find SquashFS: there is none on Alternate CD.
- Moved all the packages to
/home/username/tmp/remaster-iso/debs.
- Executed
sudo dpkg-scanpackages /home/username/tmp/remaster-iso/debs | gzip -9c > /home/username/tmp/remaster-iso/debs/Packages.gz
Updated md5sum.txt:
# find . -type f -print0 | xargs -0 md5sum > md5sum.txt
Made the iso:
sudo mkisofs -r -V "ubuntu_with_debs" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o dvd.iso /home/username/tmp/remaster-iso/
After installation I'll temporary replace sources.list with a single line:
deb file:///media/ubuntu_with_debs/debs /