[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Help!



On Thu, 17 Aug 2000, you wrote:
> Hello all!
> 
> I'm using RedHat Linux 6.2 and I have just upgraded my rpm package, from
> version 3.0.15-2 to 4.0.1pl2-7. Right after my "rpm -Uvh
> php-4.0.1pl2-7.i386.rpm" command, I kind of lost all database package
> information in my computer. When I type "rpm -qa" I get nothing!
> I tried to rebuild my database, according to some help info, typing "rpm
> --rebilddb", but it did't work. What's happening? What should I do now?
> 
> ANY help would be apreciated, thanks in advance.
> 
> Daniel Manzato
> dmanzato@uol.com.br
> System Analyst
> UOL

Below I've included Jeff Johnson's reply to my post about the same issue. It's
quite clear and resolved the problem I had. There is one N.B. For the rebuilddb
option work (for situation #1 cited below) packages.rpm had to be present.
Removing it after the rebuild presents no problem that I could find. I
recommend cp'ing or mv'ing rather than rm'ing until you know your setup is
stable.

Gary

Begin quote:

What's actually happening is that there are two co-existent rpm databases
because rpm-4.0 was not installed correctly.

FWIW, the recommended way of upgrading to rpm-4.0 is
 a) Get the latest packages (there are 5 sub-packages, see below) from
         ftp://ftp.rpm.org/pub/rpm/test
 b) Install all of the rpm-4.0 packages together
         rpm -Uvh {rpm,popt}-*
 c) Immediately do
         rpm --rebuilddb
    to convert the database format from db1 to db3.

Otherwise, here's what to do:

Look at /var/lib/rpm and look for the file that contains all the
installed headers. Specifically, the file is called
 Packages        for the db3 api used by rpm-4.0
 packages.rpm    for the db1 spi used by rpm-3.0.x and earlier.
The other files can (and will) be regenerated by doing rpm --rebuilddb,
so you can ignore them for now.

If you wish to use rpm-4.0, then packages.rpm should not be there.
If you wish to use rpm-3.0.x, then Packages should not be there.

If you have both packages.rpm and Packages, then you will need to convert
one of the two installed header files and eliminate the other. The
larger of the two files almost certainly contains the headers for
the packages installed on your system.

OK, if you've gotten this far, you have both Packages and packages.rpm
in /var/lib/rpm, and you wish to "fix".

Right now, "just in case", save a copy of all the files in your database
by doing (as root)
 cd /var/lib
 tar czvf rpmdb-save.tar.gz rpm

Presumably, if Packages exists, you have some version of rpm-4.0 installed.
If not, you will need to install rpm-4.0. In any case, get the latest
copy of rpm-4.0 from
 ftp://ftp.rpm.org/pub/rpm/test
Remember that there are 5 sub-packages of rpm
 rpm
 rpm-devel
 rpm-build
 rpm-python
 popt
At least rpm, rpm-build, and popt must be installed as part of the same
transaction set. That means that you should install in one command
 rpm -Uvh rpm-[0-9]* rpm-devel-* rpm-build-* rpm-python-* popt-*
not as a sequence of commands
 rpm -Uvh rpm-[0-9]-*
 rpm -Uvh rpm-devel-*
 ...

Depending on what you wish to do, choose one of the following:

1) "I wish to use rpm-4.0 and packages.rpm is much larger than Packages."

 a) Sanity check: You have saved /var/lib/rpm "just in case" and
    you have rpm-4.0 installed (i.e. check "rpm --version").

 b) Save the names from Packages (to be re-installed later):
         rpm -qa >& /tmp/reinstall-list

 c) Remove /var/lib/rpm/Packages by doing:
         rm /var/lib/rpm/Packages

 d) Rebuild the database (add -vv if you want to watch):
         rpm --rebuilddb
    If you've modified rpm configuration files you may need
    to force the issue by doing
         rpm --rebuilddb --dbapi 1 --rebuilddbapi 3

 e) Verify that the database contains what you have installed
    on your system by doing
         rpm -qa | more
    and checking
         /var/lib/rpm/Packages   (should be ~5-10 Mb)
         /var/lib/rpm/packages.rpm (should not exist)
    If packages.rpm does exist but you are happy with the output
    of the "rpm -qa" check, you should delete all of the db1
    files by doing
         rm /var/lib/rpm/*.rpm

 f) Re-install the packages (if any) listed in /tmp/reinstall-list.

2) "I wish to use rpm-3.0.x and Packages is much larger than packages.rpm."

 a) Sanity check: You have saved /var/lib/rpm "just in case" and
    you have rpm-4.0 installed (i.e. check "rpm --version").

 b) Save the names from packages.rpm (to be re-installed later):
         rpm -qa --dbapi 1 >& /tmp/reinstall-list

 c) Remove /var/lib/rpm/packages.rpm by doing:
         rm /var/lib/rpm/packages.rpm

 d) Rebuild the database (add -vv if you want to watch):
         rpm --rebuilddb --dbapi 3 --rebuilddbapi 1

 e) Verify that the database contains what you have installed
    on your system by doing
         rpm -qa --dbapi 1 | more
    and checking
         /var/lib/rpm/packages.rpm       (should be ~5-10 Mb)
         /var/lib/rpm/Packages           (should not exist)
    If Packages does exist but you are happy with the output
    of the "rpm -qa --dbapi 1" check, you should delete all of the db3
    files (i.e. the ones that start with Capital letters and do not
    have extension .rpm).

 f) Reinstall rpm-3.0.x (using rpm-4.0). I usually install all
    the rpm-3.0.5 packages from the current directory by doing
         rpm -Uvh --dbapi 1 --oldpackage {rpm,popt}-*

 g) Go back and verify e) (you won't need "--dbapi 1" with rpm-3.0.5)

 h) Re-install the packages (if any) listed in /tmp/reinstall-list.

The other two cases should be relatively rare and are just variants of the
above:

3) "I wish to use rpm-4.0 and Packages is much larger than packages.rpm."
 Query contents of packages.rpm (using "--dbapi 1").
 Remove /var/lib/rpm/*.rpm.
 Reinstall the packages (if any).
4) "I wish to use rpm-3.0.x and packages.rpm is much larger than Packages."
 Query contents of Packages.
 Downgrade to rpm-3.0.x (using "--dbapi 1").
 Remove /var/lib/rpm/[A-Z]*.
 Reinstall the packages found by querying (if any).

73 de Jeff

-- 
Jeff Johnson     ARS N3NPQ
jbj@jbj.org     (jbj@redhat.com)
Chapel Hill, NC



_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://listman.redhat.com/mailman/listinfo/rpm-list

https://listman.redhat.com/mailman/listinfo/rpm-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []