Results 1 to 10 of 10

Thread: Package installation failed: cannot open Packages index anymore!

  1. #1

    Exclamation Package installation failed: cannot open Packages index anymore!

    Hi openSUSE community,
    Everything was fine until I try to install the package kernel-devel this morning, I obtained an error that I ignored (unwise!).
    Now I obtain these errors:
    Code:
    orsos@linux-pkwf:~> sudo zypper clean -a
    [sudo] password for root:  
    error: rpmdb: __fop_file_setup:  Retry limit (100) exceeded
    error: cannot open Packages index using db4 - File exists (17)
    Target initialization failed:
    Rpm Exception                                                                                                                                               
    Cannot clean installed packages cache because of an error.
    Some of the repositories have not been cleaned up because of an error.
    
    Code:
    orsos@linux-pkwf:~> rpm -qa
    error: rpmdb: __fop_file_setup:  Retry limit (100) exceeded
    error: cannot open Packages index using db4 - File exists (17)
    error: cannot open Packages database in /var/lib/rpm
    error: rpmdb: __fop_file_setup:  Retry limit (100) exceeded
    error: cannot open Packages database in /var/lib/rpm
    
    Is there any way out of this?
    Thanks!

  2. #2
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,746

    Default Re: Package installation failed: cannot open Packages index anymore!

    Try

    rpm --rebuilddb

  3. #3

    Default Re: Package installation failed: cannot open Packages index anymore!

    Here we are:
    Code:
    orsos@linux-pkwf:~> sudo rpm --rebuilddb
    [sudo] password for root:  
    error: rpmdb: __fop_file_setup:  Retry limit (100) exceeded
    error: cannot open Packages index using db4 - File exists (17)
    
    How bad is this?

  4. #4
    Join Date
    Sep 2013
    Location
    Norfolk, UK
    Posts
    1,265

    Default Re: Package installation failed: cannot open Packages index anymore!

    Follow (carefully!) the full RPM Database Recovery procedure as shown here:

    http://rpm.org/user_doc/db_recovery.html

    If errors occur don't ignore them...
    Regards, Paul

    2x Tumbleweed (Snapshot: 20191016) KDE Plasma 5
    2x Leap 15.1 KDE Plasma 5

  5. #5

    Default Re: Package installation failed: cannot open Packages index anymore!

    I started the procedure on http://rpm.org/user_doc/db_recovery.html

    Code:
    orsos@linux-pkwf:/var/lib/rpm> sudo /usr/lib/rpm/rpmdb_stat -CA
    [sudo] password for root:  
    rpmdb_stat: DB_ENV->open: No such file or directory
    
    Code:
    orsos@linux-pkwf:/var/lib/rpm> lsof | grep /var/lib/rpm
    bash      2937           orsos  cwd       DIR               0,39       276      34718 /var/lib/rpm
    lsof      3031           orsos  cwd       DIR               0,39       276      34718 /var/lib/rpm
    grep      3032           orsos  cwd       DIR               0,39       276      34718 /var/lib/rpm
    lsof      3033           orsos  cwd       DIR               0,39       276      34718 /var/lib/rpm
    
    I did a backup of the rpm.
    The following command returns nothing
    Code:
    sudo /usr/lib/rpm/rpmdb_verify Packages
    Everything good so far?

  6. #6

    Default Re: Package installation failed: cannot open Packages index anymore!

    When I do...
    Code:
    sudo rpm -qa
    
    ...nothing is printed in my console, meaning no installed rpm recognized, right?
    Should I attempt at following this cookbook https://www.informatimago.com/linux/rpm-rebuilddb.html ?

  7. #7
    Join Date
    Sep 2013
    Location
    Norfolk, UK
    Posts
    1,265

    Default Re: Package installation failed: cannot open Packages index anymore!

    Quote Originally Posted by orsos View Post
    ...nothing is printed in my console, meaning no installed rpm recognized, right?
    Should I attempt at following this cookbook https://www.informatimago.com/linux/rpm-rebuilddb.html ?
    Not looking too good ...

    Yes, as the rpm database does seem rather broken, you've probably little to lose by trying that procedure, but I've no idea of the likelihood of a successful outcome.

    Prior to attempting that it may be worthwhile asking on the rpm mailing list, (see: http://rpm.org/community.html ) where there are likely more knowledgeable people who may offer better or alternate advice.
    Regards, Paul

    2x Tumbleweed (Snapshot: 20191016) KDE Plasma 5
    2x Leap 15.1 KDE Plasma 5

  8. #8
    Join Date
    Sep 2013
    Location
    Norfolk, UK
    Posts
    1,265

    Default Re: Package installation failed: cannot open Packages index anymore!

    Quote Originally Posted by orsos View Post
    Everything was fine until I try to install the package kernel-devel this morning, I obtained an error that I ignored (unwise!).
    I only just saw you had another thread, https://forums.opensuse.org/showthre...uncommon-cause

    It is quite possible as a result of that, the rpm database is in an indeterminate state...
    Regards, Paul

    2x Tumbleweed (Snapshot: 20191016) KDE Plasma 5
    2x Leap 15.1 KDE Plasma 5

  9. #9

    Default Re: Package installation failed: cannot open Packages index anymore!

    In the end, I simply reinstalled the system and now everything back on track. For my abilities, less time consuming than rebuilding the RPM db from scratch, or at least I could not find an "easy" fix.

  10. #10
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    2,559

    Cool Re: Package installation failed: cannot open Packages index anymore!

    Quote Originally Posted by tannington View Post
    I only just saw you had another thread, https://forums.opensuse.org/showthre...uncommon-cause
    It is quite possible as a result of that, the rpm database is in an indeterminate state...
    If all this is true, then, it seems that, when the system partition(s) are located within a Btrfs file system which has become full, there is a danger that, the system's RPM database will be irrecoverably corrupted.

    Which means that, the RPM database will need to be re-populated from an examination of the installed system files.
    • Catch 22: the system directories are also located within the Btrfs file system (which was over-full) and therefore, are, possibly, also corrupted.

    Therefore, IMHO, the only valid solutions are:
    1. Attempt to initialise a new RPM database from knowledge of the installed system files -- the installed RPM package list may, however, be incomplete because, some of the system files located within the Btrfs file system (which was over-full) have been corrupted;
    2. Restore the partitions located within the Btrfs file system from a reliable -- confirmed reliable -- system backup;
    3. Reinstall the system from scratch.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •