For example, let’s say you want to install some fancy new software that requires a specific version of Python. Instead of having to manually select the correct version during installation (which can be a pain in the butt), you can preseed it and save yourself time and frustration. Here’s how:
1. Create a file called “preseed.cfg” in your home directory with the following contents:
# This is an example of a preseeding configuration for Debian Installer (DI)
# It allows you to answer all those ***** configuration questions ahead of time so you don't have to deal with them during installation
# For more information, check out https://wiki.debian.org/DebianInstaller/Preseed
# Set the debconf frontend to noninteractive to avoid manual configuration during installation
d-i debconf/frontend select noninteractive
# Set the mirror country to US
d-i mirror/country string US
# Set the HTTP proxy to an empty string
d-i mirror/http/proxy string ""
# Select the network interface to use for installation
d-i netcfg/choose_interface select eth0
# Set the hostname for the computer
d-i netcfg/get_hostname string myawesomecomputer.com
# Set the nameservers to use for network configuration
d-i netcfg/nameservers string 8.8.8.8 8.8.4.4
# Select the timezone for the system
d-i timezone/select_timezone select America/Los_Angeles
# Set the system clock to use UTC
d-i clock/utc select true
# Select the keyboard layout to use
d-i keyboard/layoutcode select us
# Disable the detection of console layout
d-i console-setup/ask-detect boolean false
# Set the console layout to US
d-i console-setup/layout select us
# Set the console variant to an empty string
d-i console-setup/variant select ''
# Only install GRUB for Debian
d-i grub-installer/only_debian boolean true
# Recheck for updates during GRUB installation
d-i grub-installer/recheck_update boolean true
# Do not install GRUB for other operating systems
d-i grub-installer/with_other_os boolean false
# Set the boot device to /dev/sda
d-i grub-installer/bootdev script-config-set --value /dev/sda boot-device
# Set the default Python version to 3.8 (assuming it's available in the distribution)
d-i python3-version select '3.8'
2. Save and close the file.
3. Burn this ISO image onto a DVD or USB drive using your preferred method.
4. Boot from the media and follow the prompts to install Debian (or whatever distribution you prefer).
5. When prompted for configuration questions, DI will automatically fill in the answers based on what’s in “preseed.cfg”.
6. Enjoy your newly installed system!
Of course, this is just a basic example there are many more options and configurations available depending on your needs. For more information, check out https://wiki.debian.org/DebianInstaller/Preseed.