Anyone successfully restored a corrupt package database?

Anyone successfully restored a corrupt package database?

Post by Peter Howar » Sat, 17 Jan 2004 08:47:52



Skipping the details of how, I have a package database which is not happy.
pkginfo exits at the point it would list the offending package with a
"corrupt database" error.  The directory in /var/sadm/pkg/ still exists
for the package.  pkgrm doesn't list it.

I have tried manually removing the directory from /var/sadm/pkg, and
removing all reference of it in /var/sadm/install/contents  At this point
pkginfo stops complaining.  But if I then try to reinstall it with pkgadd
I get no errors but am back to the starting point (pkginfo barfs, doesn't
appear as an option in pkgrm).

According to the only doco I could find on package database errors -
"Rapid Recovery Techniques: Exploring the Solaris Software Registry" I get
the statement:

 There is no mechanism to repair a corrupted contents file other than to
restore from a backup.

which does not fill me with confidence.  (Before anyone asks - no there is
no backup).

It's a development box and doing a clean reinstall will not lose anything,
except time.

Anyone out there managed to manually edit their way out of a situation
like this?

PJH

 
 
 

Anyone successfully restored a corrupt package database?

Post by Paul Egger » Sat, 17 Jan 2004 14:13:57



Quote:> It's a development box and doing a clean reinstall will not lose anything,
> except time.

Then I'd say a clean reinstall is by far your best option, if you want
to save your time.

 
 
 

Anyone successfully restored a corrupt package database?

Post by Beard » Sat, 17 Jan 2004 17:31:34



> Skipping the details of how, I have a package database which is not happy.
> pkginfo exits at the point it would list the offending package with a
> "corrupt database" error.  The directory in /var/sadm/pkg/ still exists
> for the package.  pkgrm doesn't list it.

> I have tried manually removing the directory from /var/sadm/pkg, and
> removing all reference of it in /var/sadm/install/contents  At this point
> pkginfo stops complaining.  But if I then try to reinstall it with pkgadd
> I get no errors but am back to the starting point (pkginfo barfs, doesn't
> appear as an option in pkgrm).

> According to the only doco I could find on package database errors -
> "Rapid Recovery Techniques: Exploring the Solaris Software Registry" I get
> the statement:

>  There is no mechanism to repair a corrupted contents file other than to
> restore from a backup.

> which does not fill me with confidence.  (Before anyone asks - no there is
> no backup).

> It's a development box and doing a clean reinstall will not lose anything,
> except time.

> Anyone out there managed to manually edit their way out of a situation
> like this?

> PJH

I have previously seen packages that introduce corruption (eg. ^M's)
into the contents file, and cause troubles similar to yours. Suggest you
vi the contents file with the package installed, do ":set list" and look
for dodgy characters. It is a bit of a long shot though...

Trussing up the pkginfo might also shed some light...

 
 
 

1. Has anyone successfully recovered a corrupted bzip2 file ?

I have compressed a tar file with bzip2. One day later, when I
decompressed this bz2 file, bzip2 reported a CRC error. I isolated
each block with bzip2recover and wrote them into single files. 2 blocks
have a CRC error.

I assume, that only 1 or 2 bits changed their values. Is there any chance
to correct/recover these 2 blocks? Did anybody succeed with this task?

Dieter Rohlfing

2. OpenStep for Solaris

3. Anyone used a comtrol hostess 550 (8-port) successfully?

4. HELP - Openserver installation

5. Anyone Successfully run COPS on a Linux Box?

6. How to "switch system profile" in Redhat 7.3

7. Anyone add HD>8GB on solaris7 x86 successfully?

8. Sound

9. anyone successfully compiled 'expect' ???

10. anyone using mod_mhtml.c in Apache 1.2.1 successfully?

11. Anyone successfully installed Linux on a Toshiba's Libretto?

12. Anyone using Lout + ghostscript successfully?

13. Has anyone built metamail 2.7 on Solaris 7 (Successfully)