RPM Community Forums

Mailing List Message of <rpm-users>

Re: error: cannot open Packages database in /var/lib/rpm

From: <spam.spam.spam.spam@free.fr>
Date: Thu 28 May 2009 - 00:34:39 CEST
Message-ID: <1243463679.4a1dbfffb9482@imp.free.fr>
Selon Jeff Johnson <n3npq@mac.com>:

>
> On May 27, 2009, at 5:56 PM, spam.spam.spam.spam@free.fr wrote:
>
> >>
> >> Ah, that's easy fixing.
> >>
> >>
> > This is what the 'rpm --showrc' command say :
> >
> > # rpm --showrc
> > ARCHITECTURE AND OS:
> > build arch            : i686
> > compatible build archs: i686
> > build os              : Linux
> > compatible build os's : linux
> > install arch          : i686
> > install os            : Linux
> > compatible archs      : i686
> > compatible os's       : Linux
> > optflags              : -O2 -g
> >
> > MACRO DEFINITIONS:
> > macrofiles            :
> > //lib/rpm/macros://lib/rpm/i686-linux/macros:/etc/rpm/macros.*:/etc/
> > rpm/macros:/etc/rpm/i686-linux/macros:~/.rpmmacros
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ is the flaw.
>
> The "//lib/rpm/macros" is usually "/usr/lib/rpm/macros", and
> the contents of that file (macros.in from build) likely sets
> %_dbapi (and a whole lot more).
>
> Examine config.log from your build and work
> backwards to get the macro configuration paths correct.
>
> You can also do
> 	rpm --macros /usr/lib/rpm/macros --showrc | grep dbapi
> to confirm that, indeed, once the compiled in path(s) are
> correct, everything else will "just work".
>
> Note that you will likely need to untar the per-platform
> macro configuration in /usr/lib/rpm as well.
>
> This is the cpu-os-macros.tar.gz checked into CVS, and
> likely at http://rpm5.org/files/* somewhere.
>
> (aside)
> I *REALLY* wish configuring RPM were simpler, but everyone wants
> 	"Have it your own way!"
> and I don't have time to describe the foolishness of it all repeatedly.
>
> hth
>
> 73 de Jeff
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> User Communication List                             rpm-users@rpm5.org
>


If I do 'rpm --macros /lib/rpm/macros --showrc | grep dbapi' I get :

-14: _dbapi     3
-14: _dbapi_rebuild     3
-14: _dbapi_used       
%{?_rpmdb_rebuild:%{_dbapi_rebuild}}%{!?_rpmdb_rebuild:%{_dbapi}}
-14: _dbi_config        %{expand:%%{_dbi_config_%{_dbapi_used}}}
-14: _dbi_config_Basenames     
%{expand:%%{_dbi_config_%{_dbapi_used}_Basenames}}
-14: _dbi_config_Conflictname  
%{expand:%%{_dbi_config_%{_dbapi_used}_Conflictname}}
-14: _dbi_config_Depends        %{expand:%%{_dbi_config_%{_dbapi_used}_Depends}}
-14: _dbi_config_Dirnames      
%{expand:%%{_dbi_config_%{_dbapi_used}_Dirnames}}
-14: _dbi_config_Filedigests   
%{expand:%%{_dbi_config_%{_dbapi_used}_Filedigests}}
-14: _dbi_config_Filepaths     
%{expand:%%{_dbi_config_%{_dbapi_used}_Filepaths}}
-14: _dbi_config_Group  %{expand:%%{_dbi_config_%{_dbapi_used}_Group}}
-14: _dbi_config_Installtid    
%{expand:%%{_dbi_config_%{_dbapi_used}_Installtid}}
-14: _dbi_config_Name   %{expand:%%{_dbi_config_%{_dbapi_used}_Name}}
-14: _dbi_config_Nvra   %{expand:%%{_dbi_config_%{_dbapi_used}_Nvra}}
-14: _dbi_config_Obsoletename  
%{expand:%%{_dbi_config_%{_dbapi_used}_Obsoletename}}
-14: _dbi_config_Packagecolor  
%{expand:%%{_dbi_config_%{_dbapi_used}_Packagecolor}}
-14: _dbi_config_Packages      
%{expand:%%{_dbi_config_%{_dbapi_used}_Packages}}
-14: _dbi_config_Providename   
%{expand:%%{_dbi_config_%{_dbapi_used}_Providename}}
-14: _dbi_config_Provideversion
%{expand:%%{_dbi_config_%{_dbapi_used}_Provideversion}}
-14: _dbi_config_Pubkeys        %{expand:%%{_dbi_config_%{_dbapi_used}_Pubkeys}}
-14: _dbi_config_Removetid     
%{expand:%%{_dbi_config_%{_dbapi_used}_Removetid}}
-14: _dbi_config_Requirename   
%{expand:%%{_dbi_config_%{_dbapi_used}_Requirename}}
-14: _dbi_config_Requireversion
%{expand:%%{_dbi_config_%{_dbapi_used}_Requireversion}}
-14: _dbi_config_Sha1header    
%{expand:%%{_dbi_config_%{_dbapi_used}_Sha1header}}
-14: _dbi_config_Sigmd5 %{expand:%%{_dbi_config_%{_dbapi_used}_Sigmd5}}
-14: _dbi_config_Sourcepkgid   
%{expand:%%{_dbi_config_%{_dbapi_used}_Sourcepkgid}}
-14: _dbi_config_Triggername   
%{expand:%%{_dbi_config_%{_dbapi_used}_Triggername}}
-14: _dbi_tags  %{expand:%%{_dbi_tags_%{_dbapi_used}}}

And now If I do :

# rpm --macros /lib/rpm/macros --rebuilddb
Freeing read locks for locker 0x1: 27931/3079952080
Freeing read locks for locker 0x3: 27931/3079952080
Freeing read locks for locker 0x4: 27931/3079952080
Freeing read locks for locker 0x5: 27931/3079952080

It works !
I see files into /var/lib/rpm :
Basenames  Packages  Providename  Pubkeys  __db.001  __db.002  __db.003 
__db.004

But I can't install a package :
rpm --macros /lib/rpm/macros -i 8Kingdoms-1.1.0-6.fc9.i386.rpm
warning: 8Kingdoms-1.1.0-6.fc9.i386.rpm: Header V3 DSA signature: NOKEY, key ID
4ebfc273
error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regcomp failed:
Invalid preceding regular expression
Segmentation fault

1)Ok, so it's a path problem... But I absolutely want rpm is installed in the
"/" (root) directory and not in the "/usr" folder... I don't want to add the
--macro argument each time I want to use rpm from the command line... Should I
tell it to the configure script? How?

2)Why my RPM can't be installed? A regular expression problem... Why?
Received on Thu May 28 00:35:04 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.