I am attempting to make a custom ISO based off Kubuntu 22.04 (Jammy Jellyfish) and I use cubic to compile it into a ISO. Every time I install it, it replaces my sources.list with the default Ubuntu one by default for no reason whatsoever. Is there a way I can permanently replace the sources.list file?
1 Answers
This answer was adapted from How to retain a custom sources.list after the customized OS has been installed?. This solution will work for Ubuntu Desktop 22.04, 22.10, and the 23.04 Legacy Installer ISO.
On your host machine, create a
sources.listfile with the contents you desire, and save it.In Cubic's Terminal page, create a directory to store your
sources.listfile.mkdir /opt/apt cd /opt/aptDrag and drop your
sources.listfile from step 1 onto the Terminal page to copy it into the current directory (/opt/apt).Make sure the permissions are correct.
chmod a=r,u=rw sources.list ls -la sources.list # -rw-r--r-- 1 user user 0 Jul 8 19:15 sources.listCopy the new
sources.listfile to/etc/aptso you can continue customizing your OS.cp /opt/apt/sources.list /etc/aptContinue customizing your OS.
apt updateMake additional changes, as desired.
Use preseeding to update the
/etc/apt/sources.listfile after it is overwritten by Ubiquity.On Cubic's Options page, on the Preseed tab, add the following at the end of the
ubuntu.seedfile:ubiquity ubiquity/success_command string \ in-target bash -c 'cp /opt/apt/sources.list /etc/apt/';This will copy the correct
sources.listfile from/opt/apt/to/etc/apt/after successful installation of your customized OS.Generate your customized ISO and test.
- 12,792