Can we please have an "apt rollback" function?

Yes sure

apt (3.1.7) unstable; urgency=medium . [ Julian Andres Klode ] * test-history: Adjust for as-installed testing . [ Simon Johnsson ] * Add history undo, redo, and rollback features

Exciting. I just looked for docs about these new features, and can't find anything. Can you point us to these? Thanks!

If you're using btrfs, you do get that feature: https://moritzmolch.com/blog/2506.html

That fundamentally requires a snapshot-capable filesystem, so you need to use a distro designed around such.

Not necessarily. You can use the ptrace() system call to trace a process and store what it reads/writes into a journal, etc.

https://man7.org/linux/man-pages/man2/ptrace.2.html