1

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 Answers1

0

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.

  1. On your host machine, create a sources.list file with the contents you desire, and save it.

  2. In Cubic's Terminal page, create a directory to store your sources.list file.

    mkdir /opt/apt
    cd /opt/apt
    
  3. Drag and drop your sources.list file from step 1 onto the Terminal page to copy it into the current directory (/opt/apt).

  4. 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.list
    
  5. Copy the new sources.list file to /etc/apt so you can continue customizing your OS.

    cp /opt/apt/sources.list /etc/apt
    
  6. Continue customizing your OS.

    apt update
    

    Make additional changes, as desired.

  7. Use preseeding to update the /etc/apt/sources.list file after it is overwritten by Ubiquity.

    On Cubic's Options page, on the Preseed tab, add the following at the end of the ubuntu.seed file:

    ubiquity ubiquity/success_command string \
        in-target bash -c 'cp /opt/apt/sources.list /etc/apt/';
    

    This will copy the correct sources.list file from /opt/apt/ to /etc/apt/ after successful installation of your customized OS.

  8. Generate your customized ISO and test.

Enterprise
  • 12,792