From owner-freebsd-questions@FreeBSD.ORG Thu May 22 19:03:06 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02A6926D for ; Thu, 22 May 2014 19:03:06 +0000 (UTC) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id CA75720DE for ; Thu, 22 May 2014 19:03:05 +0000 (UTC) Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.41]) by be-well.ilk.org (Postfix) with ESMTP id 377F133C49; Thu, 22 May 2014 15:02:59 -0400 (EDT) Received: by lowell-desk.lan (Postfix, from userid 1147) id D8C763984E; Thu, 22 May 2014 15:02:57 -0400 (EDT) From: Lowell Gilbert To: Nagy =?iso-8859-1?Q?L=E1szl=F3?= Zsolt Subject: Re: pkg upgrade not working properly [was: pkgng messed up] References: <5374C16E.6000000@shopzeus.com> <44k39n2kg1.fsf@lowell-desk.lan> <5375B772.2050700@shopzeus.com> <537C4D66.6010306@shopzeus.com> <537C53E9.50905@FreeBSD.org> <537CD47A.6050802@shopzeus.com> <537CD7E3.6020501@freebsd.org> <537CF453.7090105@shopzeus.com> <537E224C.9010000@shopzeus.com> Reply-To: freebsd-questions@freebsd.org Date: Thu, 22 May 2014 15:02:56 -0400 In-Reply-To: <537E224C.9010000@shopzeus.com> ("Nagy =?iso-8859-1?Q?L=E1szl?= =?iso-8859-1?Q?=F3?= Zsolt"'s message of "Thu, 22 May 2014 18:14:04 +0200") Message-ID: <44y4xtocv3.fsf@lowell-desk.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org 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: Thu, 22 May 2014 19:03:06 -0000 Nagy L=E1szl=F3 Zsolt writes: > All right, I guess nobody knows the answer. I give up on this > one. Very bad first impression on pkg! There *is* no "the answer." Once you manage to mess up your ports database, there's no guarantee you'll ever be able to recover the data that was lost. Fortunately, it is much more difficult to mess up the ports database under pkgng than it was under the previous package infrastructure, so in general things get much easier. The thing you have to keep in mind is that pkgng actually stores its data differently than the old package system did, and except for a few special utilities like "pkg convert" (also known as pkg-convert(8)) and "pkg2ng", they won't recognize changes made by the other system. I'm just guessing, but my suspicion is that you did something like using pkg_add after you converted your packages to pkgng. That won't work; pkgng's database has no way to know that you added a package without telling it. > Next question: how do I remove all packages and reinstall all of them > completely, from binaries? A week or so ago, I suggested that this might be the easiest approach. > Is this possible with the pkg command? Or should I use pkg_delete If my suspicions are correct, neither one will do it, although a combination of "pkg_delete -a" and "pkg delete -a" would probably do better than either one alone. I think a better course of action would be go around both old and new commands; once you decide to remove anything anyway, there's no downside to just deleting everything. The fundamenal approach is brute force: "rm -rf /usr/local/* /var/db/pkg/*" (or something similar). Before doing that, try to collect a list of leaf ports that you'll want to reinstall later (this will save you a lot of time, unless your memory is a lot better than mine), and any configuration files under /usr/local that you have modified (I'd recommend just moving off the whole of /usr/local to some safe place until the reinstall procedure is complete, but that may be overkill in some cases). After emptying /usr/local and /var/db/pkg, delete /usr/sbin/pkg_* to keep yourself from accidentally using them again. Then reinstall packages with "pkg install".=20 Depending on what version of FreeBSD you're using, you might need to set a variable in make.conf to get various utilities to know to use pkgng. [I doubt this is necessary or useful any more, but I'm not completely sure.] Good luck.