DEV Community

Frank
Frank

Posted on

apt-xapian-index on Debian based distro's fails to update (fixed)

Debian 10 and derived distro's have a bug in the apt-xapian-index package. This package can be used to add a quick search box in Synaptic. While the package installs fine, the 'update-apt-xapian-index' command fails to complete every time, which prevents the quick search box to ever show up in Synaptic. This bug was reported to Debian on 23 August 2019, but it has not yet been fixed.

The problem is in a python script called 'relations.py' which is located in /usr/share/apt-xapian-index/plugins/. At line 113 and 114 the code is:

    for name in self.re_split.split(val):
        doc.add_term(pfx + name.split(None, 1)[0])
Enter fullscreen mode Exit fullscreen mode

This should be:

    for name in self.re_split.split(val):
        doc.add_term(pfx + name.split(' ', 1)[0])
Enter fullscreen mode Exit fullscreen mode

Change this using your favorite editor, such as Nano with root permissions. Then run 'update-apt-xapian-index' again.

I encountered this bug in the most recent SparkyLinux (version 5.13) and this fix solves the problem.

For completeness, in order to add the quick search box to Synaptic, install the package:

~$ sudo apt install apt-xapian-index
Enter fullscreen mode Exit fullscreen mode

Then apply the above fix.

Finally, update the index with:

~$ sudo update-apt-xapian-index
Enter fullscreen mode Exit fullscreen mode

Start Synpatic and you should have the quick search box.

Top comments (0)