damage to pkg's sqlite data base

andrew clarke mail at ozzmosis.com
Wed May 13 08:17:15 UTC 2015


On Wed 2015-05-13 17:55:26 UTC+1000, andrew clarke (mail at ozzmosis.com) wrote:

> $ sqlite3 local.sqlite.new
> SQLite version 3.8.10.1 2015-05-09 12:14:55
> Enter ".help" for usage hints.
> sqlite> .read local.sqlite.dump 
> sqlite> .quit
> 
> Now we can use our newly created database, which should be error-free:
> 
> $ sudo cp /var/db/pkg/local.sqlite /var/db/pkg/local.sqlite.backup
> $ sudo mv local.sqlite.new /var/db/pkg/local.sqlite
> 
> I don't guarantee any of the above will work. It will depend on how
> much the database is corrupted etc.
> 
> You will also need databases/sqlite3 installed, which unfortunately
> isn't provided in the FreeBSD base system. This could be a problem if
> pkg refuses to install anything. In that case I would either run the

Actually I was wrong about this. The pkg command has the sqlite3
interpreter built-in, accessed via "pkg shell", that opens local.sqlite
by default:

$ pkg shell
SQLite version 3.8.8.2 2015-01-30 14:30:45
Enter ".help" for usage hints.
sqlite> .quit  

So there is no real need to install databases/sqlite3.

Regards
Andrew


More information about the freebsd-ports mailing list