[Software][Solved] Aptitude stopped working

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
frankb
Posts: 3
Joined: 2024-10-11 17:47

[Software][Solved] Aptitude stopped working

#1 Post by frankb »

Aptitude has stopped working on one of my debian boxes:

Code: Select all

frank@chunky:/var/log$ aptitude search foo
terminate called after throwing an instance of 'Xapian::DatabaseNotFoundError'
terminate called recursively
Aborted
It's a headless debian 12 server with no gui istalled.

Already tried purging and reinstalling aptitude. No joy.

Any suggestions?

Frank
Last edited by frankb on 2024-10-12 14:19, edited 2 times in total.

User avatar
fabien
Forum Helper
Forum Helper
Posts: 1158
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 101 times
Been thanked: 265 times

Re: [Software] Aptitude stopped working

#2 Post by fabien »

Hello, welcome to the forums!

Please do not crosspost. If you do, at least post the link to your other post on each of the sites so people do not waste their limited time on questions that have already been asked and answered.

You were given a lead on the other site, you should have reported it, your answer gives an interesting clue.

Do the following:

Code: Select all

#> mv /var/lib/apt/lists/ /var/lib/apt/lists-SAVE/
#> aptitude update
Does this solve your problem?
Please do not delete /var/lib/apt/lists-SAVE/ yet.

Note that it is not necessarily a good thing to have apt-xapian-index installed, you may as well uninstall it.

note: please use code tags for terminal outputs, I fixed it for you this time.
If only the search function is affected, please update the title of your first post accordingly, i.e.
[Software] Aptitude search stopped working
ImageShare your Debian SCRIPTS
There will be neither barrier nor walls, neither official nor guard, there will be no more desert and the entire world will become a garden. — Anacharsis Cloots

frankb
Posts: 3
Joined: 2024-10-11 17:47

Re: [Software] Aptitude stopped working

#3 Post by frankb »

Thanks, fabien,

Sorry about the cross post. The other post is:
https://www.linuxquestions.org/question ... 175742694/.

Unfortunately, hiding /var/lib/apt/lists did not help, and "aptitude update" generated exactly the same error as "aptitude search". As far as I can tel, no aptitude commands work, although apt seems to be working as expected.

As suggested, I have purged apt-xapian-index, but that did not solve the problem.

Frank
Last edited by frankb on 2024-10-12 14:03, edited 1 time in total.

User avatar
fabien
Forum Helper
Forum Helper
Posts: 1158
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 101 times
Been thanked: 265 times

Re: [Software] Aptitude stopped working

#4 Post by fabien »

Hello, thanks for the feedback. I'm glad you solved your problem, please mark your topic as [Solved] by editing the title of your first post, i.e.
[Software] [Solved] Aptitude stopped working

However, this was just a workaround. If you are still interested in the problem, we can try to dig a little deeper.

Here is the problem you encountered (from your other thread):

Code: Select all

frank@chunky:~$ sudo  update-apt-xapian-index
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworReading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm_non-free-firmware_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworReading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_non-free-firmware_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/www.deb-multimedia.org_dists_bookwoReading en translations from /var/lib/apt/lists/www.deb-multimedia.org_dists_bookworm_main_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworReading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm_main_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/security.debian.org_debian-securityReading en translations from /var/lib/apt/lists/security.debian.org_debian-security_dists_bookworm-security_non-free-firmware_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworReading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_main_i18n_Translation-en: done.  
Reading en.diff_Index translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_main_i18n_Translation-en.diff_Index...terminate called after throwing an instance of 'Xapian::InvalidArgumentError'
terminate called recursively
Aborted
The problem seems to occur when processing the _i18n_Translation-en.diff_Index file (just a guess).
Today I was able to connect to a machine that has a _i18n_Translation-en.diff_Index file. I installed apt-xapian-index and encountered no errors:

Code: Select all

#> update-apt-xapian-index 
Reading fr translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm_main_i18n_Translation-fr: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_contrib_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_non-free_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/security.debian.org_debian-security_dists_bookworm-security_non-free-firmware_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm_non-free-firmware_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm_non-free_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/security.debian.org_debian-security_dists_bookworm-security_main_i18n_Translation-en: done.  
Reading en.diff_Index translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_main_i18n_Translation-en.diff_Index: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_main_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm_contrib_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/security.debian.org_debian-security_dists_bookworm-security_contrib_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm_main_i18n_Translation-en: done.  
Reading en translations from /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_non-free-firmware_i18n_Translation-en: done.  
Rebuilding Xapian index: done.
#>
I then purged apt-xapian-index, but the database located in /var/lib/apt-xapian-index/ is still there.
update-apt-xapian-index has a -f option to force database rebuild.
As a test, you can try reinstalling apt-xapian-index and see if the problem still occurs when run with the -f option.

Code: Select all

#> update-apt-xapian-index -f
If the problem is still there, try

Code: Select all

#> mv /var/lib/apt-xapian-index/ /var/lib/apt-xapian-index-SAVE/
#> update-apt-xapian-index
If the problem persists, can you please run

Code: Select all

$> gzip -c /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_main_i18n_Translation-en.diff_Index >/tmp/i18n_Translation-en.diff_Index.gz
and add /tmp/i18n_Translation-en.diff_Index.gz as an attachment to your post.

note: Xapian::InvalidArgumentError is documented in Xapian Python3 Bindings 1.4.26 documentation - xapian Package. It is triggered in various cases.
ImageShare your Debian SCRIPTS
There will be neither barrier nor walls, neither official nor guard, there will be no more desert and the entire world will become a garden. — Anacharsis Cloots

frankb
Posts: 3
Joined: 2024-10-11 17:47

Re: [Software] Aptitude stopped working

#5 Post by frankb »

I think I was unclear in my previous post. When I reported purging apt-xapian-index, I didn't mean to imply that this solved the problem. It didn't. I edited the earlier post to clarify that

What DID solve the problem was rebuilding the database, as you suggested, with "update-apt-xapian-index -f". I'll mark this"Solved".

Thanks for your help with this. It was driving me nuts.

Post Reply