Unlike most other existing answers, I'd like to suggest a less technical, more strategic solution.
The usual use case is not a reinstall on the same system, of the same operating system. Usually, you're migrating to a newer machine, or install a newer operating system version (or both at the same time). Naturally, then there are differences, and while any technical solution can reproduce a previous state easily, manual intervention is necessary to adapt to a new environment; in fact, changes may be so large that a lot of what you did in the past does not apply any longer, or at least not in the form you've recorded it.
If you're careful about system maintenance (meaning regular backups, imaging of the system partition, use of ephemeral VMs to try out software, and so on), these re-installations should be very rare, but eventually they do happen. To keep track of customizations and software installations, I keep a manual, written log, where I record important changes. I keep this on a cloud drive, so that it can even be edited during the initial system setup, or to record troubleshooting steps after fatal system failures.
I personally use plain text files (downside: no screenshots can be inserted, positive: easily accessible and searchable, can directly redirect diffs to it), but any note-taking program (like OneNote or Xournal++) should do as well. Here's an example of a software installation and system configuration:
- Install Nextcloud.
$ sudo add-apt-repository ppa:nextcloud-devs/client
$ sudo apt update && sudo apt install nautilus-nextcloud
- Configure Nextcloud
Applications > Accessories > Nextcloud desktop sync client
(Login in browser)
(O) Sync everything from server
[v] Ask for confirmation for larger than 500 MB
[v] Ask before syncing external storage
Local Folder: /home/inkarkat/cloud
General > General Settings
[v] Launch on System Startup
Network > Proxy Settings
(O) Use system proxy
- Set grub selection to indefinite wait, and remember the previous choice:
--- /etc/default/grub.orig 2021-01-11 07:49:21.794532830 +0100
+++ /etc/default/grub 2021-01-11 07:51:03.200229531 +0100
@@ -3,9 +3,10 @@
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
$ sudo update-grub
On a new system, I go over the old log and reapply things. Being able to copy-and-paste saves time and prevents errors, and it's very little extra effort to adapt to changes in the software that have happened in the meantime. (It also encourages you to prefer the command-line over GUI apps, as that's easier to document.) Changes can be applied in a different order, and one can apply judgement as to whether something is really needed ("application Foo? Let's see... never upgraded that one on the old system; I guess I can drop that on the new one.").
Of course, all of that will only help you with the upgrade after this one, but not with the current one - for that, you still have to work with your brittle memory and a bit of digging through the old system. I recommend this approach because I've been using this for 20 years, on numerous systems, and it has served me well.