From owner-freebsd-questions Mon Oct 28 20:34:53 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41D6C37B401 for ; Mon, 28 Oct 2002 20:34:51 -0800 (PST) Received: from obsecurity.dyndns.org (adsl-64-165-226-88.dsl.lsan03.pacbell.net [64.165.226.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5541843E6E for ; Mon, 28 Oct 2002 20:34:45 -0800 (PST) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 8273466C7B; Mon, 28 Oct 2002 20:34:44 -0800 (PST) Date: Mon, 28 Oct 2002 20:34:44 -0800 From: Kris Kennaway To: Eric van Gyzen Cc: freebsd-questions@freebsd.org Subject: Re: pkg_add(1) logic Message-ID: <20021029043444.GA72618@xor.obsecurity.org> References: <200210282231.31186.vangyzen@stat.duke.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline In-Reply-To: <200210282231.31186.vangyzen@stat.duke.edu> User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 28, 2002 at 10:31:31PM -0500, Eric van Gyzen wrote: > The following error message from pkg_add(1) doesn't make sense [to me]: >=20 > amelia:/var/db/pkg# pkg_add -r bash > Fetching ftp://blah/packages/Latest/mysql-client.tgz... Done. > pkg_add: package 'mysql-client-3.23.52' or its older version already=20 > installed > amelia:/var/db/pkg# ls -d mysql-client* > mysql-client-3.23.49 >=20 > Yes, that's correct: an /OLDER/ version is installed. I would like to=20 > update to the version on the ftp server. That's why I ran pkg_add. Why= =20 > does it not update the package without the -f flag? I realize that there= =20 > is now a pkg_update command, but it lacks the ability to fetch packages -= -=20 > and their dependencies -- remotely. >=20 > Would anyone like to explain this logic? pkg_add will not deinstall the old package before adding the new one (yes, this is a limitation). If it goes ahead and installs the new version, it will install over the top of the old one, possibly leaving old files lying around on the filesystem and certainly screwing up the consistency of your package database (/var/db/pkg). At some point in the future pkg_add will hopefully gain the ability to correctly upgrade packages; for now your best bet is to use a tool like portupgrade (with the -P switch if you like to use packages) which will do it for you correctly. Kris --+HP7ph2BbKc20aGI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9vg/jWry0BWjoQKURAlrXAJ0QGQ7VFdhg+GiakqvlQVBRTJ07MgCgirbt NthqYiHB0sHGt8M//XrmZEo= =R34g -----END PGP SIGNATURE----- --+HP7ph2BbKc20aGI-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message