Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2016 18:06:49 +0200
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-pkg@freebsd.org
Subject:   Re: '/var/db/pkg/' - Clean up old catalogue etc. files?
Message-ID:  <f5a5ea5b-4ce8-9092-52c6-be200a7ebbd1@FreeBSD.org>
In-Reply-To: <ed6f83be2a82d569ab2c42d7e51b92d5@openmailbox.org>
References:  <ed6f83be2a82d569ab2c42d7e51b92d5@openmailbox.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--KQuORosjQg4DRKcEfdSkRElGTuUMtWII3
Content-Type: multipart/mixed; boundary="oTs3QuM1LrKnjiRM7O4hLMa4WTa8qdlnb";
 protected-headers="v1"
From: Matthew Seaman <matthew@FreeBSD.org>
To: freebsd-pkg@freebsd.org
Message-ID: <f5a5ea5b-4ce8-9092-52c6-be200a7ebbd1@FreeBSD.org>
Subject: Re: '/var/db/pkg/' - Clean up old catalogue etc. files?
References: <ed6f83be2a82d569ab2c42d7e51b92d5@openmailbox.org>
In-Reply-To: <ed6f83be2a82d569ab2c42d7e51b92d5@openmailbox.org>

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f5a5ea5b-4ce8-9092-52c6-be200a7ebbd1>