Opened 3 years ago

Closed 3 years ago

#62951 closed defect (worksforme)

port - unable to recover

Reported by: mouse07410 (Mouse) Owned by:
Priority: Normal Milestone:
Component: base Version:
Keywords: Cc:
Port:

Description

Intel CPU, macOS Big Sur 11.3.1, Xcode-12.5, Macports-2.7.0.

Got a problem during update (either in sudo port self update or in sudo port upgrade outdated). Not sure how (pilot error very likely), but some Macports own files got corrupted or deleted.

I tried to re-install MacPorts-2.7.0-11-BigSur.pkg without wiping /opt/local completely. Installation hung up.

I deleted /opt/local/var/macports, and then successfully re-installed Macports, but (maybe predictably) it could not detect any of the installed ports.

OK, knowing what ports I had, I started re-installing them manually, with sudo port -f install <whatever>, -f to get through the "files already present" error.

On qemu the process stopped. I seem unable to install this port no matter what.

Is there a way to rediscover installed ports? Any other recommendation for recovery, short of rm -rf /opt/local and starting truly from scratch?

Change History (3)

comment:1 Changed 3 years ago by jmroot (Joshua Root)

Component: portsbase
Port: base? removed

Not knowing exactly what you did or how it failed, it's very hard to give advice on how to fix it. Ideally I'd want to see debug output from the initial failed selfupdate, and the installer log from when you tried installing the pkg.

Information about installed ports is stored in /opt/local/var/macports/registry, so if you deleted that, it's gone. If you have a backup of /opt/local, try restoring that. Otherwise there's no a lot you can do apart from installing from scratch. If the registry was just gone, you could look at /opt/local/var/macports/software to see what ports were installed, but i gather that's also deleted.

comment:2 Changed 3 years ago by mouse07410 (Mouse)

@Joshua, first - thank you for answering my pretty vague cry for help. I have to admit I triple-earned the title of "stupid":

  • being inattentive, screwed up the existing installation, probably by allowing two port updates to start at the same time;
  • being in a hurry to recover Macports, rushed to delete too much, thus burning the possibility of "peaceful" resolution;
  • just plain forgot that there are good backups available.

Your post reminded me that I all I need to do is restoring from the backup. Which I successfully did - thank you!

It would be great if there were tools to repair and/or restore Macports registry either from /opt/local/var/macports/software or from what's in /opt/local/bin. But I admit that restoring form a backup worked perfectly well.

P.S. One thing: updated Macports-2.7.0 gives me the following warning:

Warning: invalid universal_archs configured (should contain at least 2 archs)

Here's what my macports.conf has:

universal_archs     	x86_64

I only have Intel machines (so far), and, frankly, don't think I'd have use for fat binaries, as I build on each platform from source. But if I decide to build for Intel and M1 - what should I specify as "universal arch"? universal_archs arm64 x86_64?

Thanks again! I guess this ticket can be closed.

Last edited 3 years ago by mouse07410 (Mouse) (previous) (diff)

comment:3 in reply to:  2 Changed 3 years ago by jmroot (Joshua Root)

Resolution: worksforme
Status: newclosed

Replying to mouse07410:

@Joshua, first - thank you for answering my pretty vague cry for help.

You're welcome.

screwed up the existing installation, probably by allowing two port updates to start at the same time;

There should be locking in place to prevent that from causing problems. Bugs are always possible of course, so let us know if you can ever reproduce such a problem (admittedly unlikely now I know.)

It would be great if there were tools to repair and/or restore Macports registry either from /opt/local/var/macports/software or from what's in /opt/local/bin.

Could be an interesting research problem to see how good a job you can do reconstructing the registry from that information. Some of it just plain doesn't exist (like requested status), some of it suffers from ambiguity (multiple ports could have provided a given file.)

But if I decide to build for Intel and M1 - what should I specify as "universal arch"? universal_archs arm64 x86_64?

Yes, that would be the correct setting on Big Sur. It's also the default, so you could just comment out universal_archs in macports.conf.

Note: See TracTickets for help on using tickets.