I was building packages in MacPorts on a Mac Mini when the power went out. Now anything I try to do in MacPorts (install
, clean
, selfupdate
) results in the following error:
sqlite error: disk I/O error (3850) while executing query: ATTACH DATABASE '/opt/local/var/macports/registry/registry.db' AS registry
while executing
"registry::open $db_path"
(procedure "mportinit" line 610)
invoked from within
"mportinit ui_options global_options global_variations"
Error: /opt/local/bin/port: Failed to initialize MacPorts, sqlite error: disk I/O error (3850) while executing query: ATTACH DATABASE '/opt/local/var/macports/registry/registry.db' AS registry
How can I fix this?
Best Answer
The fix for this is actually quite simple, and is mentioned in this MacPorts issue. From a comment on the issue by "pixilla@…":
Based on another comment by "ecronin@…", I conclude that, had I run any
port
command as root, it would have been fixed automatically and saved me all this trouble. But I always forget to usesudo
...EDIT Wait, I did run a
port
command withsudo
. Weird. Oh, well, at least it works now.