I accidentally deleted /opt/local/bin/compare on a OSX Mavericks‎ system, and am not sure how to get it back.

The problem caused by this is that macports can no longer install anything.

Warning: Error parsing file /opt/local/bin/compare: Error opening or reading file

I tried re-installing, now I'm trying updating.

Does anyone know where this file originates and how to reinstall it?

Google'ing hasn't helped much so farMavericks‎, nor do I know anyone else with a mac that I could look around on for this file.


(I couldn't create the tag osx-mavericks, but I think this message should be labeled with it.)

1 Answer 1


/opt/local/bin/compare is not a OS X Mavericks supplied program.

Try to retrace your steps. The simplest is to reinstall MacPorts. Follow the entire installation guide! (i.e. reinstall Xcode and the Xcode command line tools and then MacPorts itself).

  • Thanks! I had tried re-installing just macports (not Xcode) but that didn't work. Running a full update did restore the file though. :D
    – Matt
    May 19, 2014 at 15:34
  • Super! - Could you mark the question as answered to indicate to others that the problem has been solved?
    – jksoegaard
    May 19, 2014 at 15:45
  • 1
    Reinstalling MacPorts is a bit over the top here. If this happens to you again, figure out which port installed the missing file, deactivate it using sudo port -f deactivate <portname> and re-activate it using sudo port activate <portname>. That should restore the missing file.
    – neverpanic
    Aug 15, 2014 at 23:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .