Tracker 3

AI picture.
The little man in the computer who's job is to make sure that Tracker 3 keeps running.

Tracker seems to have come from the same hell as pulseaudio and systemd. Please leave your comments down below about how that's not technically true.

I have tested this stuff on Ubuntu 22.04. On Ubuntu 24, the lines for .bashrc work. I haven't really tested anything else, but It should be close to working. I'm sure that you will be able to make it work if it doesn't. I have faith in you.

Instructions are in the DOCS section of the first code listing.

disable-tracker3-root.sh

#!/usr/bin/bash
# Disable Tracker3
# shellcheck disable=SC2034
DOCS="Disable Tracker3 on Ubuntu 22.04+ Using gnome.

Gnome tracker is so bad that I consider it to be malware.

Why?, Because:
* Tracker uses 100% cpu.
* Tracker uses nearly all disk I/O bandwidth.
* Tracker crashes when it can't read a file in your home dir.
  Such as when a file is owned by another user, or when a file
  is not world readable!
* Tracker crashes when temporary files are removed, as happens
  during software compilation, or when downloading files from
  the internet.
* Tracker crashes trying to scan partial downloads. It cannot
  parse these correctly because they are not complete files.
  Duh!
* Tracker/Gnome doesn't honor or respect user settings.
* Tracker will become re-enabled after some software updates.
* Tracker will fill up your hard drive with its garbage data.
* Tracker crashes can freeze your computer so bad that you have
  to restart it.

Tracker crashes show up as 'Ubuntu has an internal error'
or 'Files/Nautilus has crashed'.

One way that doesn't work:
	To tell Tracker Miner FS to ignore a directory and all its
	contents, you can create an empty file named '.nomedia'
	inside the directory.
This doesn't work. Anyway who would want all of those garbage
'.nomedia' files everywhere?

One way that breaks things:
  sudo chmod -x /usr/libexec/tracker-miner-fs-3
  sudo chmod -x /usr/libexec/tracker-extract-3
This will still get you the 'Ubuntu has had an internal error'
popup, and also crashes and freezes the desktop.
(Then you will need: alt+sysrq reisub)
Know that forcing unistallation using apt/deb/whatev,
or erasing the files does the same thing.

Another way that doesn't work: apt/synaptic
	You cannot use apt to uninstall Tracker3 without
	uninstalling ubuntu features that you DO want.

Another way that doesn't work: dconf-editor
	Try it and you will discover that:
	Tracker/Gnome doesn't honor or respect user settings.

Tracker3 is persistent and basically cannot be removed without
impairing Gnome. To keep it from running, I have a five step
approach. If you find that a particular step is sufficient then
there is no need to proceed further.

1. Run this file to disable tracker3 for all users (needs root).

2. Run 'disable-tracker3-run-for-user.sh' to disable tracker3
   for a user.

3. Add the following three commands to the user's .bashrc:

systemctl --user stop tracker-miner-fs-3.service  2>/dev/null
systemctl --user stop tracker-extract-3.service   2>/dev/null
systemctl --user stop tracker-miner-rss-3.service 2>/dev/null

   You can add gnome-terminal as a gnome startup app to ensure
   that .bashrc runs.

4. Run 'disable-tracker3-kill-it.sh' (drastic, but it works).

5. Don't use gnome. Try Slackware.
"

# Known Tracker services:
TRACKERS=(
tracker-miner-fs-3.service
tracker-miner-apps.service
tracker-miner-fs.service
tracker-miner-rss.service
tracker-store.service
tracker-writeback.service
tracker-extract.service
tracker-extract-3.service
tracker-writeback-3.service
tracker-xdg-portal-3.service
tracker-miner-fs-control-3.service
)

sudo systemctl          disable "${TRACKERS[@]}"
sudo systemctl          stop    "${TRACKERS[@]}"
sudo systemctl          mask    "${TRACKERS[@]}"
sudo systemctl --global mask    "${TRACKERS[@]}"

tracker3 reset -s -r
tracker3 daemon --kill

disable-tracker3-run-for-user.sh

#!/bin/bash
# Usage: disable-tracker-3-run-for-user.sh USER

# Check if an argument is supplied; if not, use the current user
if [ -z "$1" ]; then
    USER=$(whoami)
else
    USER="$1"
fi

TRACKERS=(
tracker-miner-fs-3.service
tracker-miner-apps.service
tracker-miner-fs.service
tracker-miner-rss.service
tracker-store.service
tracker-writeback.service
tracker-extract.service
tracker-extract-3.service
tracker-writeback-3.service
tracker-xdg-portal-3.service
tracker-miner-fs-control-3.service
)

# # I think this is the same as "systemctl --user mask"
# for TRACKER in "${TRACKERS[@]}"; do
# 	ln -s /dev/null ~/.config/systemd/"${USER}"/"${TRACKER}"
#  done

for TRACKER in "${TRACKERS[@]}"; do
	systemctl --user mask "${TRACKER}"
 done

# Remove tracker's index:
rm -r "${USER}"/.cache/tracker3

disable-tracker3-kill-it.sh

#!/bin/bash
# Relentlessly terminate a USER's processess that start with "tracker-"
# Usage: disable-tracker3-kill-it.sh USER

# Check if an argument is supplied; if not, use the current user
if [ -z "$1" ]; then
    USER=$(whoami)
else
    USER="$1"
fi

check_and_terminate() {
	for pid in $(pgrep -u "$USER" "^tracker-"); do
		process_name=$(ps -p "$pid" -o comm=)
		echo "Terminating process: $process_name (PID: $pid)"
		# It deserves no mercy:
		kill -9 "$pid"
	done
}

SLEEP_ENABLED=true
if [[ "$1" == "--no-sleep" ]]; then
	SLEEP_ENABLED=false
 fi

while true; do
	echo "Checking for tracker..."
	check_and_terminate

	if $SLEEP_ENABLED; then
		echo "Sleeping."
		sleep 60
	 fi
 done

So, yeah, I did this and it changed my life.

Comments:

😀 @charles2897 3 minutes ago.
The best part was where Tracker3 started tracking and said "It's trackin' time."

🍆 @susan8076 11 minutes ago.
My video is the best. Check me out at ******.com

🐶 @bryce0698 13 minutes ago.
Much wow. So effective.

🌈 @eric7278 17 minutes ago.
So mean.

🇩🇪 @brandon1278 18 minutes ago.
Actually if Tracker crashes you need to make sure that all of the files on your system are properly formatted for it. Seems like a skill issue.

🐑 @jupiter7923 23 minutes ago.
How dare you criticize systemd!