#1125017 init-system-helpers: "dpkg --purge tracker-extract" removes a symlink from package localsearch

#1125017#5
Date:
2026-01-08 12:56:44 UTC
From:
To:
Package tracker-extract has been renamed to localsearch.
So when upgrading, localsearch is installed and tracker-extract
removed. But when I do "dpkg --purge tracker-extract" to completely
get rid of tracker-extract, this removes the

  /etc/systemd/user/gnome-session.target.wants/localsearch-3.service

symbolic link, which is now part of localsearch installation.

In /var/log/dpkg.log:

2026-01-08 13:33:20 startup packages remove
2026-01-08 13:33:20 status installed tracker-extract:amd64 3.8.2-4+b1
2026-01-08 13:33:21 remove tracker-extract:amd64 3.8.2-4+b1 <none>
2026-01-08 13:33:21 status half-configured tracker-extract:amd64 3.8.2-4+b1
2026-01-08 13:33:21 status half-installed tracker-extract:amd64 3.8.2-4+b1
2026-01-08 13:33:21 status triggers-pending man-db:amd64 2.13.1-1
2026-01-08 13:33:21 status triggers-pending libglib2.0-0t64:amd64 2.86.3-4
2026-01-08 13:33:21 status triggers-pending systemd:amd64 259-1
2026-01-08 13:33:21 status triggers-pending procps:amd64 2:4.0.4-9
2026-01-08 13:33:21 status config-files tracker-extract:amd64 3.8.2-4+b1
2026-01-08 13:33:21 startup archives unpack
2026-01-08 13:33:22 install localsearch:amd64 <none> 3.8.2-10
2026-01-08 13:33:22 status half-installed localsearch:amd64 3.8.2-10
2026-01-08 13:33:22 status unpacked localsearch:amd64 3.8.2-10
2026-01-08 13:33:22 startup packages configure
2026-01-08 13:33:22 configure localsearch:amd64 3.8.2-10 <none>
2026-01-08 13:33:22 status unpacked localsearch:amd64 3.8.2-10
2026-01-08 13:33:22 status half-configured localsearch:amd64 3.8.2-10
2026-01-08 13:33:22 status triggers-awaited localsearch:amd64 3.8.2-10
2026-01-08 13:33:22 trigproc systemd:amd64 259-1 <none>
2026-01-08 13:33:22 status half-configured systemd:amd64 259-1
2026-01-08 13:33:22 status installed systemd:amd64 259-1
2026-01-08 13:33:22 trigproc man-db:amd64 2.13.1-1 <none>
2026-01-08 13:33:22 status half-configured man-db:amd64 2.13.1-1
2026-01-08 13:33:26 status installed man-db:amd64 2.13.1-1
2026-01-08 13:33:26 trigproc libglib2.0-0t64:amd64 2.86.3-4 <none>
2026-01-08 13:33:26 status half-configured libglib2.0-0t64:amd64 2.86.3-4
2026-01-08 13:33:26 status installed localsearch:amd64 3.8.2-10
2026-01-08 13:33:26 status installed libglib2.0-0t64:amd64 2.86.3-4
2026-01-08 13:33:26 trigproc procps:amd64 2:4.0.4-9 <none>
2026-01-08 13:33:26 status half-configured procps:amd64 2:4.0.4-9
2026-01-08 13:33:26 status installed procps:amd64 2:4.0.4-9
2026-01-08 13:34:15 startup packages purge
2026-01-08 13:34:15 status config-files tracker-extract:amd64 3.8.2-4+b1
2026-01-08 13:34:15 purge tracker-extract:amd64 3.8.2-4+b1 <none>
2026-01-08 13:34:16 status not-installed tracker-extract:amd64 <none>

In /var/log/apt/term.log, about the upgrade:

Log started: 2026-01-08  13:33:20
(Reading database [...] 727011 files and directories currently installed.)
Removing tracker-extract (3.8.2-4+b1) ...
Selecting previously unselected package localsearch.
(Reading database [...] 726841 files and directories currently installed.)
Preparing to unpack .../localsearch_3.8.2-10_amd64.deb ...
Unpacking localsearch (3.8.2-10) ...
Setting up localsearch (3.8.2-10) ...
Processing triggers for systemd (259-1) ...
Processing triggers for man-db (2.13.1-1) ...
Processing triggers for libglib2.0-0t64:amd64 (2.86.3-4) ...
Processing triggers for procps (2:4.0.4-9) ...
Log ended: 2026-01-08  13:33:26

At this point, I still have

lrwxrwxrwx 1 root root 43 2025-09-25 04:30:19 /etc/systemd/user/gnome-session.target.wants/localsearch-3.service -> /usr/lib/systemd/user/localsearch-3.service

$ dpkg -S /usr/lib/systemd/user/localsearch-3.service
localsearch: /usr/lib/systemd/user/localsearch-3.service

# dpkg --purge tracker-extract
(Reading database ... 727010 files and directories currently installed.)
Purging configuration files for tracker-extract (3.8.2-4+b1) ...

and /etc/systemd/user/gnome-session.target.wants/localsearch-3.service
no longer exists.

This seems to be due to

  deb-systemd-helper --user purge 'localsearch-3.service' >/dev/null || true

in the /var/lib/dpkg/info/tracker-extract.postrm script.

The maintainer cannot reproduce this issue:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1113704#51

#1125017#10
Date:
2026-01-08 13:27:55 UTC
From:
To:
Note that this is what happens when upgrading with aptitude
when tracker-extract is marked as automatically installed,
because no packages depend on tracker-extract any longer
when localsearch gets installed.

#1125017#15
Date:
2026-01-08 20:40:02 UTC
From:
To:
 From what I understand, the problem is this:
The tracker-extract package originally shipped a file
/usr/lib/systemd/user/tracker-extract-3.service
which was then renamed to
/usr/lib/systemd/user/localsearch.service when upstream renamed the
project.

Later, the tracker-extract binary package was renamed to localsearch and
during the upgrade the tracker-extract package was removed (but not
purged), i.e. the maintainer scripts of tracker-extract remained
installed and they contained code to remove
/etc/systemd/user/gnome-session.target.wants/localsearch-3.service

More specifically tracker-extract.postrm contains
deb-systemd-helper --user purge 'localsearch-3.service'
which is triggered on "purge"


The problem is, that both the tracker-extract and localsearch package
reference the same service file.

To avoid that situation, the tracker-extract package should have been
renamed at the same time the service file was renamed. So I'd argue this
is a bug in the tracker-extract/localsearch package in how they handled
the transition.
But I guess it's too late for that now.


I see two possible solutions:

a/ we introduce some kind of refcounting/package ownership in
dh_installsystemduser/init-system-helpers for packages which install the
same service file. And only if the refcount drops to zero the symlink is
removed (only a rough idea, would need some further thought)

Sounds non-trivial to me and more importantly, we can't retroactively
fix tracker-search/localsearch


b/ the localsearch package neuters the tracker-extract postrm maintainer
scripts

A small variation of b/: The localsearch package explicitly purges the
tracker-search state before installing its own symlinks.

#1125017#20
Date:
2026-02-04 23:49:57 UTC
From:
To:
Control: affects -1 src:localsearch

I'm not sure how to do that, but I'd appreciate patches or merge
requests for this issue.

Thank you,
Jeremy Bícha