When i reinstall a sofware via command line

You can move your root partition to a powered USB, and boot ONLY from the SD card, while the external drive handles the day to day grunt work of read/writing

Move the Raspberry PI root file system to a USB drive - PragmaticLinux
(this method requires a separate linux box and SD card reader)

This way the only time the SD card it touched is at boot time or when an upgrade is performed.

Overview | Using an External Drive as a Raspberry Pi Root Filesystem | Adafruit Learning System
(This one has a script that does it for you and it seems to work very well)

P.S. This works for SSD and NVME → SATA adapters on the USB connections

STICKY: HOWTO: Move the filesystem to a USB stick/Drive - Raspberry Pi Forums
(more explanation on what this is doing)

Ignore the “raspberry pi” stuff…it’s debian, and DietPi is debian