From nobody Mon Apr 04 18:42:34 2022 X-Original-To: freebsd-pkg@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A82E41A9A694 for ; Mon, 4 Apr 2022 18:42:39 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KXKQR3zpqz3nTK; Mon, 4 Apr 2022 18:42:39 +0000 (UTC) (envelope-from se@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649097759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0mUFscD6AXdT9wYidgcZE3FIUYkESsGPy0YxAPR2k8Q=; b=gcmfVdv2Iiu2bh3q5nGGsCBC/ubYRLcAO8D/yqqZMOSrfgXwSNKM/F+V3z79zcKCGuJyUE YEdq82z+N7aUqD23Fjnig38yZkDEzEZz/Hr8IPi/4/mP29q5Pdr32o6sHFGi3/g3RchjqG rvcU9UZZP+bQjgqnO6Zc/zyimG95SSF12+AvRHDHHEH119ziqZ0/X7PoITeOUwMjTbSq3k 5HhSKai4/9XoSD+2igV4bLJrpbtCwRBxkPnhg1/zyJC5l04sMwfIHSLAHui6O4b8PNbvSK FCW4yLyNv3cZpYqCh0xD1jAWwTqV3AvSLEVRoll5mqldK/88quwVPJDnT/ID0g== Received: from [IPV6:2003:cd:5f22:6f00:c199:1dd5:af00:84dd] (p200300cd5f226f00c1991dd5af0084dd.dip0.t-ipconnect.de [IPv6:2003:cd:5f22:6f00:c199:1dd5:af00:84dd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id F1E26A36D; Mon, 4 Apr 2022 18:42:38 +0000 (UTC) (envelope-from se@FreeBSD.org) Message-ID: <29ca5644-e6ae-178b-9fba-51b4531d37c5@FreeBSD.org> Date: Mon, 4 Apr 2022 20:42:34 +0200 List-Id: Binary package management and package tools discussion List-Archive: https://lists.freebsd.org/archives/freebsd-pkg List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkg@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: removing a pkg from pkg database without deleting the pkg itself Content-Language: en-US To: freebsd-pkg@freebsd.org References: <5dcfff1f-4cbd-992e-0ddc-b923b06c74e1@FreeBSD.org> From: Stefan Esser Cc: Matthew Seaman In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------33yb4Sf0JBE4TQMWRjuQKTWS" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649097759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0mUFscD6AXdT9wYidgcZE3FIUYkESsGPy0YxAPR2k8Q=; b=MuPCwq7MNup10mOtxuO+xrctycvCloPH9BT3oS0sYBODXppHvX0MkAkoLXi9tl+BHIO1eK Hldn6DxKJmLIsvBzpUG/zvHjqkKX5Q8OcZGtiNA93dfnsp8L6KvBcu8ySYMW+2VzfllD8b tQuRGbwTR15q6Q5CYZ6Cbh53OssUamm7tluu5PTXoTegZI8f+0nIZsiK5CY6GGE5tkck92 Gn2UtOSruZ025wmnIsj1mLglYbRC/faKPhRab4YBZOxHEFrPwY+BNeuJ4FP8ipzWZ7GV3/ xgGO9/EGWMBPzYswzmqz1c6mUBJmkVcDSDYzD1759/qwkc7SIMX6jG0LXaA6rA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649097759; a=rsa-sha256; cv=none; b=K392YaEZEEPseYtZweYaKfnaRopIcQHe0E9cFenbBAeQOZPLLuflb1TkB+ttdxDnsWfeiC b8GuqsRu3HFml0nUgnBQKXy00WxXWKDC7G6sq58/IFKurPfkJl1Z0+5+N+YUeAE8JUdIAo vnxZbPdIT+/GdL11mKrru8x6JmcX/atmcy8YWKRYn38B6ORFioglnyInY8MNQpmeAxDum/ 2kajSUyqrTTi2PYBaBeQfFhy2MArDZ4/EfD7sWDPQh761ycEL+jGkZdfEp4PotbbI/jAry 6z7yk/zEVGmmkg75ZOAe964AnxwZ0H2dHJY54PPvg3is8eFkNYCDkDoLRZOM0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------33yb4Sf0JBE4TQMWRjuQKTWS Content-Type: multipart/mixed; boundary="------------YpTCGGPcnu3q9fLiqVTAYiXb"; protected-headers="v1" From: Stefan Esser To: freebsd-pkg@freebsd.org Cc: Matthew Seaman Message-ID: <29ca5644-e6ae-178b-9fba-51b4531d37c5@FreeBSD.org> Subject: Re: removing a pkg from pkg database without deleting the pkg itself References: <5dcfff1f-4cbd-992e-0ddc-b923b06c74e1@FreeBSD.org> In-Reply-To: --------------YpTCGGPcnu3q9fLiqVTAYiXb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 04.04.22 um 18:38 schrieb Matthew Seaman: > On 04/04/2022 16:27, tech-lists wrote: >> On Mon, Apr 04, 2022 at 03:35:16PM +0200, Stefan Esser wrote: >>> Am 04.04.22 um 15:26 schrieb tech-lists: >>>> Hi, >>>> >>>> I'd like to remove a pkg entry from the database so it's not managed= by pkg. >>> >>> The simplest way to exclude an installed package from being managed >>> by pkg is to use "pkg lock": >>> >>> # pkg lock -y >>> >>> See "man pkg-lock" for more details. >> >> That will work for a time, but won't it stop other packages linked to = it from >> being updated? If this package is installed as a dependency of some other package, you can expect inconsistencies and conflicting dependencies to arise over time. >> The packages in question are nextcloud and drupal. I have used "pkg lock" for NextCloud and it worked for me ... >> The other thing is that even with pkg lock, I seem to recollect it'll = still >> show up in packages-that- >> need-upgrading in the daily cronjob. I might be wrong about that thoug= h. >=20 > pkg(8) doesn't really have a concept of giving up management of a packa= ge that > it originally installed. Not only that, but pkg does not manage individual packages, but wants to have an intact dependency graph. Only "loosely" connected packages can be excluded from that graph without issues cropping up over time. In case of e.g. NextCloud you can manage the PHP interpreter and general PHP modules with pkg and the nextcloud sub-tree independently using the update procedure provided by NextCloud. > What you could do is use 'pkg info' to generate a list of the files ins= talled > by the package.=C2=A0 Feed that into tar(1) to create a backup, then us= e pkg(8) to > delete the package and tar to recover the files from your backup.=C2=A0= There will > be a short service outage while you do that: if that's not acceptable t= hen you > can probably adapt the procedure by using tar(1) or similar to copy the= package > files to an alternate filesystem location, making whatever config chang= es you > need to in your webserver and application config to serve the site from= the new > location, and then deleting the original package. You can fetch the package with "pkg fetch" (or may already have a copy in /var/cache/pkg) and directly extract from that file, without prior installation via the pkg command. You have to check for any install scripts, but these exist in only a small fraction of the ports. The just go to the root directory and extract all files with paths that start with /usr/local: # tar xf /var/cache/pkg/ /usr/local This should work for most packages, but there might be cases where the more complex method suggested by Matthew gives slightly better results. Regards, STefan --------------YpTCGGPcnu3q9fLiqVTAYiXb-- --------------33yb4Sf0JBE4TQMWRjuQKTWS Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmJLPBoFAwAAAAAACgkQR+u171r99US+ hAf+JjyPtEvOfMPOG7BRmgoYN6VmhtsZjo5QYsly5wK4XXQF/hwHPaFBU2dsaUSHdrERONtfFgYT gHuN3co4v7EKzzPIZYPJz5VOrk9bvtqEJMqv3syhUfwnUUk+Qzj9qTefJrsW6EtTQTiyP0ped3e8 C9Uj2Uj/t8a+yV8OUabGzKcENsvN3XIUg3i9VrcVjrtJClQLzRJ/i9VvoOfQ8OkR+FHk00EqslkZ e54ujr7xQ4sMaFKgSnNnTE7gOeUNmyPzzJrjBzERMAaVE0w4me+2v0xB8JqDgj040b9wmY6cTp2T uRk3qorf4qXYPHN1Lc412yQVRmTHhFJWk7BwoT1T8w== =5oY8 -----END PGP SIGNATURE----- --------------33yb4Sf0JBE4TQMWRjuQKTWS--