How I can customize the Ubuntu Live ISO installer using Cubic (add, remove, and upgrade packages and set language)?

I would like to modify the ubuntu 20.04 installation iso to include (vlc, audacious,mc,rar,unrar, spanish support,etc), remove (totem,rhythmbox,english support, etc) and upgrade packages. Use Cubic but change the permissions of various system directories. Leading to a security risk. For example /etc and /usr have 777 I need customize installer becouse the computers I want installer don't have network acces I need customize installer because I live in Cuba and is very difficult access online repository from anywhere also the connections are too slow for example in this PC (256kbs).


Solution 1:

  1. Install Cubic

    First, make sure you have the latest version of Cubic following the instructions at the Cubic web page.

    sudo apt-add-repository ppa:cubic-wizard/release
    sudo apt update
    sudo apt install cubic
    
  2. Launch Cubic

    Navigate to the Terminal page.

  3. Add the necessary repositories

    add-apt-repository --yes main
    add-apt-repository --yes restricted
    add-apt-repository --yes universe
    add-apt-repository --yes multiverse
    

    Remove your existing packages.

    apt autoremove --purge totem rhythmbox
    

    You should probably leave the English language packages and let them automatically be removed by the installer after installation of the OS (see step 8 below).

  4. Upgrade packages

    apt upgrade
    
  5. Add your new packages

    apt install vlc audacious mc rar unrar
    
  6. Install your language packages

    (You will find these are already installed in the Live ISO).

    apt install language-pack-es language-pack-es-base language-pack-gnome-es language-pack-gnome-es-base
    

    Cubic Terminal Page

  7. Update permissions

    I recommend being very careful when doing this. Making files inside /etc accessible to all users may cause your system to not boot, because some files must only be readable by root.

    As an example, you can change permissions for /etc/network and all files or directories in it to 777:

    cd /etc/
    chmod -R u+rw,g+rw,o+rw network
    
  8. Tell the Ubiquity installer to not remove your language packages

    Navigate to the Packages page.

    Click (anywhere) on the list, and begin typing the word "language" to search for packages that begin with this word.

    Uncheck the following four packages:

    • language-pack-es
    • language-pack-es-base
    • language-pack-gnome-es
    • language-pack-gnome-es-base

    This will ensure that the installer does not remove your language packages. This is not strictly necessary, since we will select your language and locale in the preseed below (step 9), but it is a good measure nevertheless.

    You will also notice that the English language packages are flagged (check-marked) to be automatically removed by the installer after installation of your customized OS (if English is not selected as your default language).

    enter image description here

  9. Select your default language and locale

    Navigate to the Options page, and select the Preseed tab.

    Click on /preseed/ubuntu.seed in the left pane.

    Configure your locale and language by appending the following text at the end of this file. (Note that "es" = Spanish, and "CU" = Cuba).

    # Set language, country and locale.
    d-i debian-installer/language string es
    d-i debian-installer/country string CU
    d-i debian-installer/locale string es_CU.UTF-8
    
    # Specify additional locales to be generated.
    d-i localechooser/supported-locales multiselect es_CU.UTF-8
    
    # Set keyboard layout.
    d-i keyboard-configuration/xkb-keymap select es
    
    # Set time zone and region.
    d-i time/zone string America/Havana
    d-i debian-installer/region string es_CU.UTF-8
    

    Optionally, if you want multiple locales generated, separate them with commas as show here:

    # Specify additional locales to be generated.
    d-i localechooser/supported-locales multiselect es_CU.UTF-8, fr_CH.UTF-8, en_US.UTF-8
    

    Here are some references if you are configuring different languages or locales:

    • List of ISO 639-1 Language Codes
    • List of ISO 3166-1 County Codes
    • List of Ubuntu Time Zones

    enter image description here

  10. Generate your customized ISO

    Finally, navigate to Cubic's Generate page to create your customized ISO.

    enter image description here