Another option, if you are testing/experimenting software installations, is to use dietpi-backup:
https://dietpi.com/forum/t/resolved-cannot-log-in-to-the-mysql-server/41/1
Once the image is updated, do a stock installation (with no software changes).
Then backup system, install software, test, then restore. No need to write a new image each time.