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

RE: HELP: rpm can't find the db when I upgraded



Jeff,

Thanks. Many Thanks! :)

Greg

-----Original Message-----
From: rpm-list-admin@redhat.com [mailto:rpm-list-admin@redhat.com]On
Behalf Of Jeff Johnson
Sent: Thursday, February 08, 2001 3:01 PM
To: rpm-list@redhat.com
Subject: Re: HELP: rpm can't find the db when I upgraded


On Thu, Feb 08, 2001 at 02:42:48PM -0500, Greg Kopp wrote:
> OS: RedHat Linux 6.2
>
> I upgraded RPM to rpm-4.0-6x.i386.rpm and now rpm no longer knows that I
> have anything installed.
>
> Could someone PLEASE help me figure out what went wrong and how to fix it?
I
> am desperate.
>

See below.

BTW, rpm-4.0.1 is at
	ftp://ftp.rpm.org/pub/rpm/test-4.0.1
These are the final bits, I've been too busy to announce. Installing
rpm-4.0.1
is way easier than the procedure below.

73 de Jeff


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).

--
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





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