Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 Feb 2015 09:29:59 +0000
From:      Matthew Seaman <matthew@freebsd.org>
To:        freebsd-ports@freebsd.org
Subject:   Re: Problem with the pkg datebase
Message-ID:  <54D87E17.7070506@freebsd.org>
In-Reply-To: <54D87AAC.7070600@ecoracks.nl>
References:  <54D87AAC.7070600@ecoracks.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--LxWcKWU5HVbQ7c6Wn4roNS0RCbr1jK0mT
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 02/09/15 09:15, Willem Jan Withagen (EcoRacks) wrote:
> Hi,
>=20
> Trying to run a 'pkg upgrade -f' which gives me:
>=20
> pkg: sqlite error while executing UPDATE packages SET name=3D?1  WHERE
> name=3D?2; in file pkg_jobs.c:1576: UNIQUE constraint failed: packages.=
name
>=20
> And upgrading is not really possibe.
>=20
> How do I fix the database?

The unique key in the pkg DB changed from port origin to port name
relatively recently.  This means you've managed to get two packages with
the same name but different origins installed -- one way it seems fairly
common to do that is when you had the docbook ports installed, but you
haven't been updating them religiously, but there are other ways.

Try:

  pkg query -a "%n\t\t%v %o" | sort | less

and try and spot the repeated name. You may also see some packages that
have been arbitrarily renamed to avoid this sort of collision. Deleting
the affected packages (either repeated name or renamed) and reinstalling
should solve the problem.  There aren't any name collisions possible in
the ports anymore, so once you're fully up to date this shouldn't happen
again.

	Cheers,

	Matthew



--LxWcKWU5HVbQ7c6Wn4roNS0RCbr1jK0mT
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQJ8BAEBCgBmBQJU2H4XXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw
MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTnVMoQAIqw2ZFtqwk36zKO3+cgs3sj
JVk9goyhHtdmpsTU9eNyUv7eVIBUqdHOlbj1oFjGVtyVsrLopoFHi55+7SZpuJ89
PFUlfSCr0FL+XRYdrGpUia+qMWkaZtdFcbGuyGIhagWT25/Fy+Jt6uFZG0fwQRA1
EVeDrFeLeZ/aHS9xgt55ZhUVwnfkqozfiwfBM4j4AVXCLvNTsVqHcF2wG5O6jJ2j
7VO8j4iFfpbrFcYYb7uhrS/rW5X43e8OBhLAGdKQ0MiDe55o0cM8uE9rgzU9zBI8
zNMwoK20eO8vSai8W4Dnd6IGdOBeNzquDlyEdFHJe6q4rMaFioldj60L3R/9kd+w
Y6euRcZ+nCd+aRAlPV7qwueK+V1ef+kjkchm0CN8k74JcdR+tJxp8ZKD9jzB5fay
kIO6uURcrkByb+ira+amBd5PZP0euQQxAeVg7Awi7guSZ26LrQSGRWxdHGlN9Zaw
YkNr8iisPTPlm9X/1+6XazFTspsztT2tn7n4G7cMkaAlu2sRnorfKR9cB0HvMHJp
K0heFeamEqajtQpJwvbgfweiVBZ9Z7IN+XB/fER6XqW41fXXlLxFLI4SK01PWtyn
S1WKJlgO8fX2F1wtn8Qg/c0t6HOw1qdyL0bxsuPlpL4x/zYC8Io3cJAGXm9jsVF+
Hvw69aftb2GenSikYIvJ
=vka6
-----END PGP SIGNATURE-----

--LxWcKWU5HVbQ7c6Wn4roNS0RCbr1jK0mT--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54D87E17.7070506>