The following procedures are followed in the production of Linux Mint flash drive installation media:
# Download latest release of Linux Mint ISO
wget https://mirrors.gigenet.com/linuxmint/iso/stable/21.1/linuxmint-21.1-cin...
2023-02-01 12:05:43 (42.8 MB/s) - ‘linuxmint-21.1-cinnamon-64bit.iso’ saved [2681571328/2681571328]
# Download sha256sum.txt and sha256sum.txt.gpg
wget https://ftp.heanet.ie/mirrors/linuxmint.com/stable/21.1/sha256sum.txt
2023-02-01 12:13:27 (12.8 MB/s) - ‘sha256sum.txt’ saved [292/292]
wget https://ftp.heanet.ie/mirrors/linuxmint.com/stable/21.1/sha256sum.txt.gpg
2023-02-01 12:13:51 (39.2 MB/s) - ‘sha256sum.txt.gpg’ saved [833/833]
# Perform an integrity check on the downloaded image
sha256sum -b linuxmint-21.1-cinnamon-64bit.iso
2df322f030d8ff4633360930a92d78829d10e515d2f6975b9bdfd1c0de769aca *linuxmint-21.1-cinnamon-64bit.iso
# Compare the above output against the content of sha256sum.txt, the outputs should match
cat sha256sum.txt
2df322f030d8ff4633360930a92d78829d10e515d2f6975b9bdfd1c0de769aca *linuxmint-21.1-cinnamon-64bit.iso
f7fb9c0500e583c46587402578547ea56125e0a054097f9f464a2500830c8b25 *linuxmint-21.1-mate-64bit.iso
6fea221b5b0272d55de57f3d31498cdf76682f414e60d28131dc428e719efa8b *linuxmint-21.1-xfce-64bit.iso
# Import the Linux Mint signing key
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key "27DE B156 44C6 B3CF 3BD7 D291 300F 846B A25B AE09"
gpg: key 300F846BA25BAE09: "Linux Mint ISO Signing Key " not changed
gpg: Total number processed: 1
gpg: unchanged: 1
# Verify the authenticity of sha256sum.txt: The output of the last command should tell you that the file signature is
# "good signature" and that it was signed with the A25BAE09 key. If you see a warning about not being certified
# with a trusted signature this is normal, and generally not a concern
gpg --verify sha256sum.txt.gpg sha256sum.txt
gpg: Signature made Sun 18 Dec 2022 07:54:36 AM EST
gpg: using RSA key 27DEB15644C6B3CF3BD7D291300F846BA25BAE09
gpg: Good signature from "Linux Mint ISO Signing Key " [unknown]
Primary key fingerprint: 27DE B156 44C6 B3CF 3BD7 D291 300F 846B A25B AE09
# Plug in a USB flash drive and unmount any auto-mounted partitions to ensure reliability of written image
# At a minimum make sure the size of the flash drive matches what you inserted to avoid accidentally
# overwriting important data
fdisk -l
Disk /dev/sda: 59.75 GiB, 64160400896 bytes, 125313283 sectors
Disk model: Flash Drive
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sda1 128 125313250 125313123 59.8G 7 HPFS/NTFS/exFAT
umount /dev/sda1
umount: /dev/sda1: not mounted.
# Write the Linux Mint ISO to disk
sudo dd if=linuxmint-21.1-cinnamon-64bit.iso of=/dev/sda bs=4M
639+1 records in
639+1 records out
2681571328 bytes (2.7 GB, 2.5 GiB) copied, 98.9166 s, 27.1 MB/s
# Run the sync command to flush any data to disk and make sure it's written
sync
# Identify the size of the ISO image using the stat command
stat -c '%s' linuxmint-21.1-cinnamon-64bit.iso
2681571328
# Along with the above number output use the head command to check the portion of the disk we've written
# the ISO to Prior to running this command it isn't a bad idea to unplug the USB drive and connect it again
sudo head -c 2681571328 /dev/sda | sha256sum
2df322f030d8ff4633360930a92d78829d10e515d2f6975b9bdfd1c0de769aca -
# Make sure the output above matches what is in the sha256sum.txt file we downloaded earlier
cat sha256sum.txt
2df322f030d8ff4633360930a92d78829d10e515d2f6975b9bdfd1c0de769aca *linuxmint-21.1-cinnamon-64bit.iso
f7fb9c0500e583c46587402578547ea56125e0a054097f9f464a2500830c8b25 *linuxmint-21.1-mate-64bit.iso
6fea221b5b0272d55de57f3d31498cdf76682f414e60d28131dc428e719efa8b *linuxmint-21.1-xfce-64bit.iso
# In this case the above matches so we can conclude that the ISO image is fully and properly written to disk