"pkginfo: ERROR: bad entry read in contents file"

When attempting to list the contents of a VRTSvxvm package, I received the following error:

$ pkginfo -l VRTSvxvm
pkginfo: ERROR: bad entry read in contents file
    pathname: /etc/vx/slib/libc.so.1
    problem: unable to read content info
   
The first step is to check for a corrupt /var/sadm/install/contents file. Open the file with vi, and issue :set list to show any control characters in the file. Scroll down to the line containing "/etc/vx/slib/libc.so.1" and look for any obvious errors.

In our case, the following entries in /var/sadm/contents/install caused problems with pkglist:

pathname: /etc/vx/slib/libc.so.1
pathname: /etc/vx/slib/libdevice.so.1
pathname: /etc/vx/slib/libdevinfo.so.1
pathname: /etc/vx/slib/libnsl.so.1
pathname: /etc/vx/slib/libnvpair.so.1
pathname: /etc/vx/slib/libsocket.so.1
pathname: /etc/vx/slib/libthread.so.1

We did have a system with an identical version of Veritas Volume Manager installed. Here are the appropriate entries from the non-working system:

egrep "/etc/vx/slib/libc.so.1|/etc/vx/slib/libdevice.so.1|/etc/vx/slib/libdevinfo.so.1|/etc/vx/slib/libnsl.so.1|/etc/vx/slib/libnvpair.so.1|/etc/vx/slib/libsocket.so.1|/etc/vx/slib/libthread.so.1" contents
/etc/vx/slib/libc.so.1 f none 0755 root other 0555 root bin +VRTSvxvm
/etc/vx/slib/libdevice.so.1 f none 0755 root other 0555 root bin +VRTSvxvm
/etc/vx/slib/libdevinfo.so.1 f none 0755 root other 0555 root bin +VRTSvxvm
/etc/vx/slib/libnsl.so.1 f none 0755 root other 0555 root bin +VRTSvxvm
/etc/vx/slib/libnvpair.so.1 f none 0755 root other 0555 root bin +VRTSvxvm
/etc/vx/slib/libsocket.so.1 f none 0755 root other 0555 root bin +VRTSvxvm
/etc/vx/slib/libthread.so.1 f none 0755 root other 0555 root bin +VRTSvxvm

Here are the appropriate entries from the working system:

# egrep "/etc/vx/slib/libc.so.1|/etc/vx/slib/libdevice.so.1|/etc/vx/slib/libdevinfo.so.1|/etc/vx/slib/libnsl.so.1|/etc/vx/slib/libnvpair.so.1|/etc/vx/slib/libsocket.so.1|/etc/vx/slib/libthread.so.1" contents
/etc/vx/slib/libc.so.1 f none 0755 root other ? ? ? +VRTSvxvm
/etc/vx/slib/libdevice.so.1 f none 0755 root other ? ? ? +VRTSvxvm
/etc/vx/slib/libdevinfo.so.1 f none 0755 root other ? ? ? +VRTSvxvm
/etc/vx/slib/libnsl.so.1 f none 0755 root other ? ? ? +VRTSvxvm
/etc/vx/slib/libnvpair.so.1 f none 0755 root other ? ? ? +VRTSvxvm
/etc/vx/slib/libsocket.so.1 f none 0755 root other ? ? ? +VRTSvxvm
/etc/vx/slib/libthread.so.1 f none 0755 root other ? ? ? +VRTSvxvm

I was able to get pkglist to work when replacing the entries from the working system with the old entries. Make sure to backup the /var/sadm/install/contents file before making any changes.

I would not recommend manual modification of this file as a long-term solution. If you have access to "working" entries, you could attempt to replace the problematic entries as a short-term fix.

A better solution would be to remove the Veritas packages, check pkginfo functionality, and reinstall Veritas. If pkginfo does not work after uninstalling the Veritas packages, a complete reinstall of the system would be a good idea, as the integrity of /var/sadm/install/contents is critical.

Back to brandonhutchinson.com.
Last modified: 06/11/2003