8

currently we have problems with our new Ubuntu 22.04 desktops and the tracker3 file indexing. We have a shared home server exporting the user homes, which is under cosntant load due to the file indexing (tracker-miner-fs-3 process). Therefore, I would like to deactivate it completely.

I already tried this: (see LINK)

systemctl --user mask 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

and

tracker3 reset -s -r (which gives Found 0 PIDs…)

and creating ~/.config/autostart/tracker-miner-fs-3.desktop with

[Desktop Entry]
Hidden=true

But this does not do the trick.

tracker3 daemon gives:

root@:~# tracker3 daemon
Miners:
01 Jul 2022, 12:04:45:  ✗     File System          - Not running or is a disabled plugin

But the process is still running after reboot and consuming ressources... Does anyone have an idea on how to disable the indexing completely?

Thank you very much!

DenverCoder9
  • 99
  • 1
  • 5

4 Answers4

6

I was with the same problem on Ubuntu 22.04.1 LTS and like you, none of the web stuff using 'systemctl' or 'tracker3 reset' was worked.

I solved making some files non executables with:

sudo chmod -x /usr/libexec/tracker-miner-fs-3
sudo chmod -x /usr/libexec/tracker-extract-3

Then reboot

I know it's a little bit crazy but it's worked for me

EMILIO
  • 267
  • 1
  • 2
  • 8
  • 3
    Thanks! That works. Yes, it's a bit "crazy" but what's more crazy is that Ubuntu made the whole desktop environment depend on those resource hungry processes. I went a bit more crazy with deleting all tracker services: `sudo rm /usr/lib/systemd/user/tracker-*` and made all tracker files not executable: `sudo chmod -x /usr/libexec/tracker-* /usr/libexec/tracker3/* /usr/bin/tracker3`. Then, reclaim wasted disk space: `rm -Rf ~/.cache/tracker3` – Gael Oct 17 '22 at 08:50
  • When I removed tracker permissions, it also started crashing if I try to search within a directory. Is there a way to disable the indexing but still be able to search just within a directory? If I ever need to search system-wide, I'll use find or something, but you shouldn't need indexing to look through a directory containing O(hundreds) of files. – user2671688 Jun 21 '23 at 13:14
5

To disable Tracker3 on Ubuntu 22.04 and avoid updates:

sudo apt-mark hold tracker
sudo apt-mark hold tracker-extract
sudo apt-mark hold tracker-miner-fs

sudo chmod -x /usr/libexec/tracker-extract-3
sudo chmod -x /usr/libexec/tracker-miner-fs-3

tracker3 reset --filesystem --rss # Clean all database
tracker3 daemon --terminate

To undo:

sudo apt-mark unhold tracker
sudo apt-mark unhold tracker-extract
sudo apt-mark unhold tracker-miner-fs

sudo chmod +x /usr/libexec/tracker-extract-3
sudo chmod +x /usr/libexec/tracker-miner-fs-3

tracker3 daemon --start

This solution is a workaround. But it works.

If you want to check all settings of Tracker3 for the current user, run the command:

gsettings list-recursively | grep Tracker

In this settings it is possible to enable or disable the Tracker3 for specific directories.

  • This looks like the cleanest solution for this question. It almost works the same on ubuntu 20.X, just auto complete some of the names in the commands (because they are slightly different) and leave the `3` from the tracker command. – Jessie Koffi Jul 28 '23 at 17:17
1

I think the following can be considered an answer, as it might solve the OP's original problem without totally disabling tracker.

On my Ubuntu 22.04, I discovered that I can edit the list of indexed directories using

dconf-editor

a window pops up and you can navigate to /org/freedesktop/tracker/miner/files

and then alter the files index-recursive-directories and index-single-directories.

Moreover, the explanations for the file ignore-directory-with-content let me understand that I can have tracker3 ignore any directory containing e.g. a .trackerignore file or .git file. This seems to be a handy way to avoid some heavy tracking if needed. I am not sure if having a .git directory instead of .git file would have the same effect, so I decided to put a .trackerignore file in the folder that contains my git projects.

However, I tried another path to edit the index-recursive-directories and index-single-directories configurations:

this was the tracker3 index command.

Run without any flag, it displays the indexed directories with the recursive/non-recursive info but I didn't manage to alter these options with the options proposed by

tracker index --help

I hope this little information can help anyone landing here.

gcousin
  • 142
  • 7
0

You can do this in a way that will survive package upgrades by using dpkg-divert to rename the service files. This way when the tracker packages are upgraded the renaming will be preserved:

for file in /usr/lib/systemd/user/tracker-*;do dpkg-divert --add --rename --divert $file.ORIG $file;done

Remove the diversions this way:

for file in /usr/lib/systemd/user/tracker-*;do dpkg-divert --remove --rename --divert $file.ORIG $file;done
user7037
  • 61
  • 2