pkg: sqlite error while executing PRAGMA user_version

Matthew Seaman m.seaman at infracaninophile.co.uk
Sun Aug 3 13:31:01 UTC 2014


On 03/08/2014 14:09, Wolfgang Hukriede wrote:
> Matthew Seaman wrote:
> 
>   # pkg shell
>   SQLite version 3.8.5 2014-06-04 14:06:34
>   Enter ".help" for usage hints.
>   sqlite> select * from pkg_lock ;
>   0|0|0
>   sqlite> select * from pkg_lock_pid ;
>   sqlite> .quit
> 
> Yes, this is what I get.
> 
> In the meantime I discovered that "pkg info" works on the diskless box
> when invoked as root. I then tried "pkg upgrade -n" and "pkg upgrade".
> This worked after some contortions. (It first said "locked", while
> the second or third attempt was ok.)
> 
> Becoming somewhat more confident I tried a "pkg delete nnn", but
> interrupted that with control-c. This seems to have been a mistake,
> because now I get "database is locked" consistently and nothing works,
> while output for "select * from pkg_lock" is "1|1|0" and "select *
> from pkg_lock_pid" returns a number (A pid? But there's no process
> with that pid).
> 
> Any way to remove to lock? 

OK.  This is unsupported and requires you to run SQL commands manually
directly against your local package DB.  Fat-finger this and you can
cause catastrophic results.  Use at your own risk.  Slippery when wet.
Beware of dog.

Backup your database first.

# pkg shell
SQLite version 3.8.5 2014-06-04 14:06:34
Enter ".help" for usage hints.
sqlite> update pkg_lock set exclusive=0,advisory=0,read=0 ;
sqlite> select * from pkg_lock ;
0|0|0
sqlite> delete from pkg_lock_pid ;
sqlite> select * from pkg_lock_pid ;
sqlite> .quit

We offer no guarantees that the sqlite schema will remain compatible in
any future version of pkg(8).  The locking system in particular has been
seen to be in need of attention after recent pkg(8) releases.

Good luck.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.

PGP: http://www.infracaninophile.co.uk/pgpkey
JID: matthew at infracaninophile.co.uk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1036 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20140803/80740382/attachment.sig>


More information about the freebsd-questions mailing list