How to fix a corrupt Solaris package database

When trying to remove package SMCsudo you get the error

#pkgrm SMCsudo

The following package is currently installed:
SMCsudo sudo
(sparc) 1.6.8p4

Do you want to remove this package? y

## Removing installed package instance <SMCsudo>
(A previous attempt may have been unsuccessful.)
## Verifying package dependencies.
## Processing package information.
## Removing pathnames in class <none>
/usr/local/sbin <shared pathname not removed>
/usr/local/man <shared pathname not removed>
/usr/local/libexec <shared pathname not removed>
/usr/local/etc <shared pathname not removed>
/usr/local/doc <shared pathname not removed>
/usr/local/bin <shared pathname not removed>
## Updating system information.
pkgrm: ERROR: bad read of contents file
pkgrm: ERROR: pathname=/usr/lib/iconv/sparcv9/UTF-8%PCK.so
pkgrm: ERROR: problem=no memory for package information

do

# cd /var/sadm/pkg

which is where the package database is located

then delete the offending package that you are trying to remove.

rm -rf SMCsudo

Then the package is removed the ugly (hack) way.

So then you can now install thenewer version of the same package.

# pkgadd -d /tmp/SMCsudo

Leave a Comment

You must be logged in to post a comment.