Tested on Gnome 40.x/41.x/42.x (Ubuntu) but must work on 38.x and grater.
The code is arranged to easy [human] inspection, read it before proceed; be aware that copy & pasting code on the internet is a bad pactice.
Copy the code below and paste it on your terminal + enter, no sudo is needed.
for cmd in stop disable mask; do \
echo "${cmd} the tracker services..."
systemctl --user ${cmd} \
tracker-extract-3.service \
tracker-miner-fs-3.service \
tracker-miner-rss-3.service \
tracker-writeback-3.service \
tracker-xdg-portal-3.service \
tracker-miner-fs-control-3.service 2> /dev/null ;\
done ; \
echo "Freeing space by erasing the actual tracker DB..."
tracker3 reset -s -r
echo "Done!"
This script does the following:
- Stop the tracker services.
- Disable the tracker services.
- Mask the tracker services (to avoid gnome can start it without your intervention)
- Reset [like in ERASE] the local collected database to reclaim the space.