MacPorts reinstall : problem, sqlite error: database disk image is malformed

Rainer Müller raimue at macports.org
Wed Jul 6 05:21:22 PDT 2016


On 2016-07-06 09:54, guillaume trebuchet wrote:
> Is it possible to repair the database or reinstall port (the uninstall
> procedure doesn't work because of the registry problem) ?
> 
> for information, i try :
> {{{
> sudo port -fp uninstall installed
> }}}
> And this is the result :
> {{{
> sqlite error: database disk image is malformed (11) 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:
> database disk image is malformed (11) while executing query: ATTACH
> DATABASE '/opt/local/var/macports/registry/registry.db' AS registry
> }}}

The SQLite DB is usually very stable and often able to repair itself.
However, in this case it looks like it is not able to recover from the
damage done to the file at all.

Even restoring a previous version of this registry.db would not be
useful, as the information stored in the registry will no longer match
files present in the filesystem, especially if this shutdown happened
while a port command was running. That would lead to problems later when
installing or upgrading ports encounter unregistered files.

Unfortunately, your best option is to start again from a clean reinstall.

https://guide.macports.org/#installing.macports.uninstalling

As the first step will no longer work, just skip it.

Rainer


More information about the macports-users mailing list