From owner-freebsd-pkg@freebsd.org Wed Sep 21 16:07:06 2016 Return-Path: Delivered-To: freebsd-pkg@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBAF2BE469A for ; Wed, 21 Sep 2016 16:07:06 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [IPv6:2001:8b0:151:1:c4ea:bd49:619b:6cb3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 55DBDC18 for ; Wed, 21 Sep 2016 16:07:06 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from liminal.local (unknown [109.111.229.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id EB85B16D6 for ; Wed, 21 Sep 2016 16:07:00 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/EB85B16D6; dkim=none; dkim-atps=neutral Subject: Re: '/var/db/pkg/' - Clean up old catalogue etc. files? To: freebsd-pkg@freebsd.org References: From: Matthew Seaman Message-ID: Date: Wed, 21 Sep 2016 18:06:49 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KQuORosjQg4DRKcEfdSkRElGTuUMtWII3" X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_00, RCVD_IN_BRBL_LASTEXT, RDNS_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:07:06 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KQuORosjQg4DRKcEfdSkRElGTuUMtWII3 Content-Type: multipart/mixed; boundary="oTs3QuM1LrKnjiRM7O4hLMa4WTa8qdlnb"; protected-headers="v1" From: Matthew Seaman To: freebsd-pkg@freebsd.org Message-ID: Subject: Re: '/var/db/pkg/' - Clean up old catalogue etc. files? References: In-Reply-To: --oTs3QuM1LrKnjiRM7O4hLMa4WTa8qdlnb Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 21/09/2016 16:25, zhaghzhagh@openmailbox.org wrote: > Hello >=20 > Looking in to my host's '/var/db/pkg/' directory I spot a few catalogue= , > metadata etc. files that belong to already removed repositories. >=20 > Is there any documented (or manual but safe) way to remove these files?= > Looking into the manual pages of 'pkg' did not bring much luck. Removin= g > downloaded package binaries I can, 'pkg clean', removing old repository= > related files, not. >=20 > Directory looks like this, for example, all 'myrepo...s' should be gone= > (to save some disk space): >=20 > [root@domain /var/db/pkg]# ls -l > total 608532 > -rw-r--r-- 1 root wheel 246 Sep 15 09:24 FreeBSD.meta > drwxr-xr-x 2 root wheel 512 Apr 4 22:05 apr-1.5.2.1.5.4 > drwxr-xr-x 2 root wheel 512 Apr 4 22:02 db5-5.3.28_3 > drwxr-xr-x 2 root wheel 512 Apr 4 22:03 expat-2.1.0_3 > drwxr-xr-x 2 root wheel 512 Apr 4 20:46 gettext-runtime-0.19.7= > drwxr-xr-x 2 root wheel 512 Apr 4 20:50 gettext-tools-0.19.7 > drwxr-xr-x 2 root wheel 512 Apr 4 22:06 help2man-1.43.3_1 > -rw-r--r-- 1 root wheel 246 Sep 15 09:24 latest.meta > -rw-r--r-- 1 root wheel 9178112 Sep 15 18:52 local.sqlite > -rw-r--r-- 1 root wheel 246 Mar 26 02:58 myrepo.meta > -rw-r--r-- 1 root wheel 246 Apr 13 18:30 myrepo2.meta > -rw-r--r-- 1 root wheel 246 Apr 13 18:33 myrepo3.meta > -rw-r--r-- 1 root wheel 246 Apr 13 18:33 myrepo4.meta > -rw-r--r-- 1 root wheel 246 Jun 14 06:57 myrepo5.meta > drwxr-xr-x 2 root wheel 512 Apr 4 22:05 p5-Locale-gettext-1.06= > drwxr-xr-x 2 root wheel 512 Apr 4 21:57 perl5-5.20.3_8 > drwxr-xr-x 2 root wheel 512 Apr 4 21:20 perl5.20-5.20.3_8 > -rw-r--r-- 1 root wheel 246 Sep 15 07:31 quarterly.meta > -rw-r--r-- 1 root wheel 246 Aug 6 13:15 release_1.meta > -rw-r--r-- 1 root wheel 246 Aug 6 13:15 release_2.meta > -rw-r--r-- 1 root wheel 246 Aug 6 13:15 release_3.meta > -rw-r--r-- 1 root wheel 47077376 Sep 15 18:49 repo-FreeBSD.sqlite > -rw-r--r-- 1 root wheel 47077376 Sep 15 18:49 repo-latest.sqlite > -rw-r--r-- 1 root wheel 78458880 Apr 18 18:06 repo-myrepo.sqlite > -rw-r--r-- 1 root wheel 42881024 Apr 18 18:06 repo-myrepo2.sqlite > -rw-r--r-- 1 root wheel 43790336 Apr 18 18:06 repo-myrepo3.sqlite > -rw-r--r-- 1 root wheel 44890112 Apr 18 18:06 repo-myrepo4.sqlite > -rw-r--r-- 1 root wheel 46038016 Jun 14 12:31 repo-myrepo5.sqlite > -rw-r--r-- 1 root wheel 46558208 Sep 15 18:49 repo-quarterly.sqlite > -rw-r--r-- 1 root wheel 78751744 Aug 6 13:15 repo-release_0.sqlite > -rw-r--r-- 1 root wheel 43214848 Aug 6 13:15 repo-release_1.sqlite > -rw-r--r-- 1 root wheel 44131328 Aug 6 13:15 repo-release_2.sqlite > -rw-r--r-- 1 root wheel 45265920 Aug 6 13:15 repo-release_3.sqlite > -rw-r--r-- 1 root wheel 408576 Sep 14 19:20 repo-repository.sqlite= > -rw-r--r-- 1 root wheel 246 Sep 14 19:21 repository.meta > -r--r--r-- 1 root wheel 4627951 Sep 20 03:43 vuln.xml There isn't a 'clean up the pkgdb' command as such. You'll just have to make do with trusty rm(1). In fact, there is only one file in the pkgdb that you can't easily replace by downloading a fresh copy. That's local.sqlite which is the database of what is actually installed on your system. Everything else you should be able to pull down again by a combination of 'pkg update -f' and 'pkg audit -f' However, to avoid unnecessary downloads, and assuming you have 'FreeBSD' and 'myrepo' repositories configured (check the output of 'pkg -vv' to confirm), then these are the files you should keep: FreeBSD.meta local.sqlite myrepo.meta repo-FreeBSD.sqlite repo-myrepo.sqlite vuln.xml That, at least is whay pkg(8) needs under /var/db/pkg. If you use portmaster(1) you'll find it does create some old-style pkgname-version sub directories. IIRC, the content there is not critical. Cheers, Matthew --oTs3QuM1LrKnjiRM7O4hLMa4WTa8qdlnb-- --KQuORosjQg4DRKcEfdSkRElGTuUMtWII3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJX4rAeXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATWcEQAIAuO4y3HonqdclHgry/XfWP REzJrjJOXD7x82/FNMTTp/6AkGX7AwaXyvoDRYy6YBjcBppHUnNDE8fnF5e88AMu rKIH54GbQyieYi9b7rc7CKLpahn0hR1u49+htCS6i6IftAJqgw8l1LZrDnIPo4bY vzdtBoCxnJ1178XCm0qHgjwafCcLamnzsFuIoUoC3OnNnHFv7aj0YR3qa8TaZAHU wVCe4UnT1devPcY2VcqQ+4mDu1Zak2IowpRy+gEjhX0kaJO+1FtlfxLk59p8QBsw Rvmb7JTTvOeu2f5doVuqoDBLTYV2YnkLPpYxDEyraUNYrP5XtyzxKOhMM7mDxXfT 3P6HcpF30NKBgDf6hMhX/ypFHu3CL/MfRaL4APkGsNhfiUzeRHGLPg5cBdftEdCM rqQFKOQPOo9b1rwmAXlc+3en7KYAtYKa0Yplwjcx6ufreDCe4g/KiI543ZWwpZQF 4qJRuWsv2xgjXIMGC/lyz+WyMZY/Jp4x+1e1hwaf99MCJ3/gN16zDOy3GTQccmVE c3IueSLsiHoao/xsfG3bmii/BDmFwH1shvORNJyvLh74XW8vvTA487V0pJbJYWVJ nZOsGy/Z4f6wT0g42HbMxzP/P9HMr9rQVXepClp3aNJhTaMG58Marh7bFaOoQ9x8 urHbnsEMuAITwvadEEy/ =G6EW -----END PGP SIGNATURE----- --KQuORosjQg4DRKcEfdSkRElGTuUMtWII3--