From owner-freebsd-questions@FreeBSD.ORG Mon May 19 19:13:05 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB923352 for ; Mon, 19 May 2014 19:13:04 +0000 (UTC) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "ca.infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 972A72CC1 for ; Mon, 19 May 2014 19:13:04 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.2.117.99]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.8/8.14.8) with ESMTP id s4JJCwZo044115 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 19 May 2014 20:12:59 +0100 (BST) (envelope-from matthew@FreeBSD.org) Authentication-Results: lucid-nonsense.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org DKIM-Filter: OpenDKIM Filter v2.8.3 smtp.infracaninophile.co.uk s4JJCwZo044115 Authentication-Results: smtp.infracaninophile.co.uk/s4JJCwZo044115; dkim=none reason="no signature"; dkim-adsp=none Message-ID: <537A57B9.9000600@FreeBSD.org> Date: Mon, 19 May 2014 20:12:57 +0100 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: error: pkg-static: sqlite: database is locked References: In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="f7XS0gjTeCQXxdmclwcnrjSr2UQ6v7jN2" X-Spam-Status: No, score=-3.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lucid-nonsense.infracaninophile.co.uk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 19:13:05 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --f7XS0gjTeCQXxdmclwcnrjSr2UQ6v7jN2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 19/05/2014 18:33, Xavier wrote: > When I try to install/compile/register any port, always I get > 'pkg-static: sqlite: database is locked'. >=20 > I try 'pkg unlock -a' but it don't solved it. >=20 > How I solved this problem of ports ? sqlite is not a multi-user database -- it doesn't do MVCC for instance. Meaning that a 2nd process trying to use the database, even read-only, while the first process is updating it has no way of guaranteeing any sort of consistent results. Hence pkg has quite strict locking requirements. In general, you cannot run more than one instance of pkg at one time. This is the most common cause of 'database is locked' messages. Locking has been heavily reworked for the upcoming pkg-1.3, so there should be fewer such incidents in future. It's also tricky to manage locking if /var/db/pkg is on an NFS mounted partition. Recent versions of pkg are more NFS resistant, but in my opinion, not using NFS is the route to happiness. 'pkg unlock' and 'pkg lock' have nothing to do with this problem. They're all about marking some of your installed packages as not to be modified, rather than controlling concurrent access to the package database in its entirety. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey --f7XS0gjTeCQXxdmclwcnrjSr2UQ6v7jN2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.20 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTele5XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATWuUQAJdNiJkh9JueynZeikUmczPH 9IqedjLqGsc0LaZwUeaY8XO1LB9862VezBXB/PpKUg4/I32sLbVnv3NC1w6iTfpZ gu8cInv4zTRhEJK1qXGHG+664JEtaK9gEoaZOqqVeFF9sM1iTrioUTczddoBgx0J eSIb7p8bzMsUAxAmBnJwZHMSA3ypCzJq3dtBvxBkuokdhAcPr4MsjqLlprrf9gbp NFyAyEHHI5cFFyNYt6dLr473xjLN+7LD5R5TBwito/ZVJkM+91T0O2p0DVHsn6kz 9D7dCliw8QxAT6g/Y8WKevWZlO+4KQKhSpg/bYbVwlpg0qQ6R2a7keqwgWAiZnGh A2bu+uWPI3ljXoIDBum6/Gx29r3x9sC+Q3XBvrSrcI5iIx/rbWkOEtBBmB71XhxE ltew6TzLq0SogeMBITuieVvMGa0k6vxbvxZ+U/9mjn4+JBontW+nRgZ+GGa4B3Mz 1NwMNMunwVtofJmtsK9WgYB3ruv6iswzsCYlLn0yiNhRzZURtfbHJs/o1OWl3Mp7 LXwxEZW1LxXluDA4mYxDaJiCsFnUmtS+Meemv4beTJDKvVoh0fRxD/qP1BITs5W2 sPukHMLVabAAzY7QBuWotO0UNnkS6/yEBY8Xp47vXgWIcw4v8D7SBx8IN/zFgW7b dcSQxsmwn8klwHzaWHaf =jhpw -----END PGP SIGNATURE----- --f7XS0gjTeCQXxdmclwcnrjSr2UQ6v7jN2--