How to Create Custom Linux Mint or Ubuntu ISO

Installing Linux Mint is not a big deal.

It’s the things to do after installing Linux Mint that might feel tedious.

And when you have to do the same thing on more than one system, it gets frustrating.

Imagine you have multiple computers in your home, lab, or institution. And all must have similar configurations and applications.

Imagine that now. You download Linux (Mint), create a live USB and install it on all systems. And then you have to do the same configuration and install the same applications on all of them.

What if I tell you there is a way to save your time from these repetitive tasks? How about creating a modified ISO and putting that customized Linux Mint on the live USB stick? This way, the same customized Linux distribution will be installed on all systems.

There’s a handy GUI tool called Cubic that you can use to do this Pre-configure your installations in the simplest way.

Let me walk you through the features and how you can use it to customize Linux Mint 21 ISO.

Note that Cubic should work with other distros like Ubuntu, Fedora, etc. I tested it with Mint, but you can try following the steps for other distros.

Cubic: The easiest way to create custom ISO images

custom ISO creator

cubic (Cusual Ubare you ISO Creator) is a GUI tool for customizing Ubuntu-based distributions.

It gives you the chroot environment of ISO where you will make significant changes and it also allows you to choose packages for minimal and normal installation separately.

But before we jump to the procedure, let’s take a look at some of Cubic’s features.

Key features of Cubic:

  • Easy to use GUI.
  • Allows separate selection of packages for minimal and normal installation.
  • It has three tabs for specific reasons:
    1. Kernel tab: If you have multiple kernels installed, you can specify the boot kernel here.
    2. Pressed Tab: From here you can create, edit and remove pressed files. If you use compressed files, you can skip the questions that are generally asked during installation, since compressed files automate the process!
    3. Boot tab: If you are interested in changing boot parameters, here you can tweak how the modified ISO will boot.
  • Provides various types of compression formats to compress modified ISO files.
  • Comes with QEMU (Open Source Machine Emulator and Virtualize) to test modified ISOs.

Seems too promising, doesn’t it? So let’s proceed with the installation process.

Installing Cubic in Ubuntu-based distributions

Cubic is not available in Ubuntu’s default repository, so you need to add PPA to install the software that is not available in the default repository:

sudo apt-add-repository ppa:cubic-wizard/release

Now let’s update the repository and install Cubic:

sudo apt update && sudo apt install cubic

And that’s it!

Now let’s move on to how you can use Cubic to adjust ISO.

How to use Cubic to create custom ISO images

For this tutorial I’m using Linux Mint 21 ISO. To make this guide more relevant, I will do the following operations:

  • Removal of unnecessary packages, making it a minimal ISO of Linux Mint.
  • Update remaining packages to the latest version.
  • Add new wallpapers.
  • Install the latest Linux kernel (6.0).

You can make your own modification as you like.

1. Adding/creating a project directory

Select project directory in cubic

When you open Cubic you will be prompted to select the project directory. That’s none other than where you want all the files related to creating custom ISO images to be.

Here I created a new subdirectory in my HOME directory. Make sure you have a separate directory for each Cubic project you create. When you are done selecting the project directory, click the Next Button.

2. Select the original ISO image

Here you need to select the original ISO image that you want to work with.

Choose the original ISO

As you can see I went with Linux Mint 21 and it pulled all the other information automatically.

3. Working with the chroot environment

Once you have selected the ISO, the ISO image will be extracted and you will end up in a chrooted environment.

Screenshot of 2022 10 21 14 13 26

This will behave like a normal terminal and this is also where I will be doing most of the customization related operations.

remove packages

It’s entirely up to you how many packages you want to remove, or you can skip the package removal section. To remove a package you don’t have to use the sudo you normally use, as removing packages requires superuser privileges.

So let’s say you want to remove Thunderbird; then the following command should do the job:

apt purge thunderbird

But as I told you before, I will go for a minimal desktop and remove most of the additional GUI apps including Libreoffice. And if you want to do the same:

apt purge drawing gnome-calculator hexchat hypnotix libreoffice* onboard redshift redshift-gtk rhythmbox sticky thingy thunderbird warpinator webapp-manager
remove packages

Yes, it’s that simple!

Update existing packages

If you want to have the latest packages in your next Ubuntu installation, consider this step:

sudo apt update && sudo apt upgrade
Update to the latest packages

Adding background images

First, let’s change the current working directory to /usr/share/backgrounds:

cd /usr/share/backgrounds

Since Cubic allows users to drag-and-drop files into the current working directory (in our case /usr/share/backgrounds), I’ll copy my wallpapers (which I downloaded locally).

Copy images by drag and drop

It needs to be this if you want to change the background from the file manager, but if you want them listed in the change background dialog you need to add them each in an XML file located at /usr/share/ gnome- located. background properties.

Adding Linux kernel 6.0

In this section I will download the .deb package containing kernel headers and modules and then install them using the dpkg command.

Use the given 4 commands one by one and it will download kernel modules and headers:

wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.0/amd64/linux-headers-6.0.0-060000_6.0.0-060000.202210022231_all.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.0/amd64/linux-headers-6.0.0-060000-generic_6.0.0-060000.202210022231_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.0/amd64/linux-image-unsigned-6.0.0-060000-generic_6.0.0-060000.202210022231_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.0/amd64/linux-modules-6.0.0-060000-generic_6.0.0-060000.202210022231_amd64.deb

Once you’re done with the downloads, you can install them using the dpkg command:

dpkg -i *.deb
Install Linux kernel 6.0 in Ubuntu

4. Select packages to remove from a minimal and normal installation

With Cubic you can even specify the list of software for minimal and normal installation.

Select packages for minimal and normal installation

This is the place to be creative as you have 2 lists of software that you can use for different purposes.

For example, you can use the normal installation option for desktop usage and the minimal installation should be used for more minimal setups like servers.

Since I’ve already removed packages, I don’t have much left to do in this section.

5. Select Boot Kernel

This section contains the list of Linux kernels that you have.

Choose the boot kernel

If you are wondering why 3 options are shown, let me tell you how:

  • 5.15.0-41 was preinstalled.
  • 5.15.0-52 was installed when I updated existing packages.
  • 6.0 was installed manually by me.

I go here with Linux kernel 6.0!

6. Choose the ISO compression type

This is the last step in the configuration where you need to choose the compression algorithm.

Choose the iso compression algorithm

You don’t need to know each compression type as it has already given the chart by which you can choose the strength of the compression.

And I go with the standard gzip Possibility.

When you are done selecting the compression type, click Generate button and your ISO will be created!

7. Testing the ISO file with the built-in QEMU emulator

Once the Cubic has finished creating the ISO you instructed, you can test the ISO file. To test the file, you need to click the Test below in the upper left corner:

Click the test button to start the Qemu emulator

And it started QEMU:

running qemu

And I ran into a problem when trying to update repositories saying: Please use apt-cdrom so that this CD-ROM can be recognized by APT.

How to solve “Please use apt-cdrom to make this CD-ROM recognized by APT”

Please use apt cdrom to make apt recognize this CD-ROM

To solve this problem, you just need to disable the installation disk (CD-ROM) from software resources.

Open Software Resources in Linux Mint and if you are using Ubuntu you will need to use the Software and Updates tool.

disable cd rom

Once you disable the CD-ROM, it should work like any generic ISO you download from the official site!

All repositories are working fine as expected

That was fast. Right?

last words

This was my take on how you can easily create custom ISO images of Ubuntu or other Linux distributions with Cubic with its practical use.

If this is something you could use, give it a try. Let me know in the comments if you get stuck and I’ll do my best to help.


Leave a Reply

Your email address will not be published. Required fields are marked *