Page 1 of 1

a fatel error occured could not open rpm db() [SOLVED]

PostPosted: Apr 2nd, '16, 14:42
by mtwilson
I am new to Mageia and a relative Linux noob as well. I have Mageia 5 installed as a virtual machine with VMware on an iMac running OS 10.10.5. I have been playing around in regular user mode just looking at the directories and such and working on my CLI skills, then I went to look at the software GUI updater and got this message - a fatel error occured could not open rpm db() /usr/lib/perl5/vendor_perl/5.20.1/Rpmdrake/open.db.pm line 74...

So I went to that directory and opened the file and here is where I think the error is;

Code: Select all
sub open_rpm_db {
    my ($o_force) = @_;
    my $host;
    log::explanations("opening the RPM database");
    if ($::rpmdrake_options{parallel} && ((undef, $host) = @{$::rpmdrake_options{parallel}})) {
        state $done;
        my $dblocation = "/var/cache/urpmi/distantdb/$host";
        if (!$done || $o_force) {
            print "syncing db from $host to $dblocation...";
            mkdir_p "$dblocation/var/lib/rpm";
            system "rsync -Sauz -e ssh $host:/var/lib/rpm/ $dblocation/var/lib/rpm";
            $? == 0 or die "Couldn't sync db from $host to $dblocation";
            $done = 1;
            print "done.\n";
        }
        URPM::DB::open($dblocation) or die "Couldn't open RPM DB";
    } else {
        my $db;
        if ($::env) {
            #- URPM has same methods as URPM::DB and empty URPM will be seen as empty URPM::DB.
            $db = new URPM;
            $db->parse_synthesis("$::env/rpmdb.cz");
        } else {
            $db = URPM::DB::open($::rpmdrake_options{'rpm-root'}[0]);
        }
        $db or die "Couldn't open RPM DB (" . ($::env ? "$::env/rpmdb.cz" : $::rpmdrake_options{'rpm-roo
t'}[0]) . ")";
    }
}

I have searched around and it looks like I may need to re-install or update the rpm.db but I have not found anything that is specific to Mageia yet so I thought I would look for help from the community. I also search this forum and Mageia support before posting this and found nothing related.

I would appreciate any help or advice. BTW, this is a clean install from an iso downloaded yesterday from Mageia directly. Thanks in advance!

Re: a fatel error occured could not open rpm db()

PostPosted: Apr 2nd, '16, 15:30
by doktor5000
When posting code or log excerpts or some output, please next time use code tags as explained in ftp://ftp5.gwdg.de/pub/linux/mandriva/m ... e_tags.ogv

mtwilson wrote:I have searched around and it looks like I may need to re-install or update the rpm.db but I have not found anything that is specific to Mageia yet so I thought I would look for help from the community.


Yes - the problem is not the code you listed, but that your rpm database is borked. To fix it, as root run
Code: Select all
rm -f /var/lib/rpm/__db*
rpm --rebuilddb

Re: a fatel error occured could not open rpm db()

PostPosted: Apr 2nd, '16, 18:45
by mtwilson
Thanks for the help. The rebuild worked great! I will follow your tip on code posts in the future. Thanks again for the hand holding ;)

Re: a fatel error occured could not open rpm db() [SOLVED]

PostPosted: Jul 30th, '16, 09:19
by mhausle
Thanks too! :P

Re: a fatel error occured could not open rpm db() [SOLVED]

PostPosted: Aug 3rd, '16, 12:23
by wintpe
its odd that you had this issue, i too saw this issue on my mga5 workstation.
i found the solution, from google, but is there a problem, with the updater.

regards peter

Re: a fatel error occured could not open rpm db() [SOLVED]

PostPosted: Jun 28th, '17, 18:14
by ximoberna
I've had a problem with rpm.db after an energy cut while updating kernel...

The same solution solved all my problems and got the updates running.