How to make a custom Linux Mint iso image
This tutorial is all about making a custom Linux Mint iso from a fresh new official dvd image. Download the image from the official download page of Linux Mint (latest is recommended). Now follow the steps below to make a customized Linux Mint cd/dvd image: Conventions adopted in this tutorial:
- Text with greyed background means warning
- Blue color means, this part of the code needs editing after copy paste
- Italic texts means they are technical words/codes
- Small italic texts means codes.
- Some codes are so long that they couldn't end in a single line, watch out...
- Texts appear after double slash (//) are comments not codes.
- Red colored text tells you to pay serious attention to it
1. Install the required softwares:
2. Prepare the temporary system:
linuxmint-19-cinnamon-64bit.iso is used as the base iso image throughout this tutorial. Change the name according to the downloaded image.
3. Prepare network connection in the temporary system:
4. Prepare a chroot environment:
Now this terminal is in your new system. Don't close this in any circumstances. We will call this the chroot terminal and let's open another terminal and run:
and call this the host terminal. We will use this terminal when needed. You can differentiate between these two by comparing the command history. (This is very important, don't mix up these two terminals in anyway.) Run codes in chroot terminal if nothing is specified about which terminal to use.
5. Preparing customization:
6. Now customize at your hearts content:
The filesystem is now the "edit" folder inside "mylivecd" directory. You can modify this filesystem to meet your needs. But you only have access to the chroot terminal. So make sure you can do everything with only a terminal. You can use this terminal to run GUI applications too.
To view installed packages by size:
6.1 Installing softwares:
First update the repository (in chroot terminal):
Install softwares from the chroot terminal by:
then use synaptic package manager to install software.You can run other GUI applicaions too.
If you use synaptic then you will probably need to delete the edit/home/* manually and also delete the edit/run/synaptic.socket in the cleaning step.
In this case the some_package.deb must be located somewhere inside the "edit" directory. So copy the deb files that you want to install by dpkg to a location inside that edit folder and use correct path to the files or use my conventions as below (in chroot terminal):
Now use your file manager (open as root) to copy files for your packages to this folder or you can use the host terminal too (to copy files here). Now you can use the chroot terminal to install softwares from that directory (.deb files or source). To install softwares you can see the methods written in this tutorial:
Installing softwares in linux
If you have the latest .deb packages then you can copy them into the "/var/cache/apt/archives" directory so that you will be able to install them with the
command in chroot terminal without downloading them. But if they are not latest, then this will do no good at all.
To install all the .deb packages in any directory simply run in chroot terminal:
6.2 You can do other types of modifications as you have full access to the whole filesystem, if you know how to do it in any regular distro. The main problem is, you have no GUI (Desktop) for making modifications, all there is to edit the config files and the filesystem to modify everything. So you need to be sure about the modifications that they will work correctly beforehand.
6.3 Kernel installation (optional):
First install any kernel (see this for reference) with the chroot terminal then to boot this kernel in live cd/dvd run these codes in the host terminal:
If you install more than one kernel then replace * in the above two commands with correct version codes.
6.4 At last, run this code in chroot terminal to make sure the Linux mint installation application (in live dvd/cd) is up-to-date:
7. Cleanup your new system:
If you used synaptic (or any other GUI) then you will probably need to do this extra cleaning:
From this moment the chroot environment is no more, but this terminal will be used for the rest of the commands, you can close the other (host) terminal.
8. Regenerate manifest (ignore any warning):
9. Compress:
10. Update some required files:
open extracted/README.diskdefines file with a text editor and change the name of the disk.
Remove old md5sum and calculate new md5sums:
11. Create the ISO image:
12. Test the ISO image:
You can use qemu, kvm, virtualbox for a test run of the iso or you can use your physical computer for testing (making a live usb or burning the iso to cd or dvd). If everything is satisfactory then you can make this a final release of your new custom Linux Mint dristro.