MacPorts “PortIndex file may be corrupt” Resolution
Posted in Uncategorized on May 29th, 2010 by Rugmonster – Be the first to commentIn the past few months, I moved to a Mac, which has been great. Shortly after switching, I found MacPorts, which has also been great. The other day, however, when doing an upgrade, I got the following warning over and over and my upgrade wouldn’t complete:
Warning: It looks like your PortIndex file for rsync://rsync.macports.org/release/ports/ may be corrupt.
I couldn’t find a clear answer on what was going on, until I found a bug report on the MacPorts site. The fix for this will be put into MacPorts 1.9.0, but I’m on 1.8.2 now, so that doesn’t help much.
The issue sounds like it has to do with a cache of the PortIndex can build up stale information. My brute force resolution was to remove that cache. I wasn’t terribly sure where that was, but I did find it.
$ locate PortIndex.quick
/opt/local/var/macports/sources/rsync.macports.org/release/ports/PortIndex.quick
$ sudo rm /opt/local/var/macports/sources/rsync.macports.org/release/ports/PortIndex.quick
Alternatively, you could move the file out of the way if that makes you more comfortable.
Once that was done, I went ahead and gave it try.
$ sudo port sync
Warning: No quick index file found, attempting to generate one for source: rsync://rsync.macports.org/release/ports/
$ sudo port upgrade outdated
...
All worked as it should! So until we see MacPorts 1.9.0, this will be my solution should I see this come up again.

