pkg(8) is "Compressing files ..."

This seems to be a feature I don't recall in the past.
Yes, that's new. I noticed it as well on the last package upgrade: https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly/

Index_of_FreeBSD_15_amd64_quarterly.png


What's being compressed, and if I have ZFS compression already, why does it need to be compressed twice?
Apparently files.pkg is decompressed and re-compressed again, to safe space. Nothing to do with ZFS. Not every FreeBSD file system is ZFS, there are users using UFS.

/var/db/pkg/repos/FreeBSD-ports
Code:
% ls -l
-rw-r--r--   1 root wheel 31149062 Dec  2 21:39 files

% file files
files: Zstandard compressed data (v0.8+), Dictionary ID: None

Regarding files.pkg: pkg-repo(8)
Rich (BB code):
DESCRIPTION
    ...
     files.pkg is an optional compressed archive containing files, a
     directory-grouped listing of all files present in all packages in the
     repository.  It is only generated when the -l flag is used.  The file
     uses a compact line-based text format where paths are grouped by
     directory.  When fetched by pkg-update(8), this data enables
     pkg-rwhich(8) to look up which remote package provides a given file.  See
     pkg-repository(5) for a full description of the format.
Note, the manual pkg-rwhich(8) as of pkg version 2.9.4 doesn't exist yet.

Example usage of 'pkg-rwhich':
Code:
% pkg rwhich /usr/local/bin/sudo
/usr/local/bin/sudo is provided by package sudo-1.9.17p2_5
/usr/local/bin/sudo is provided by package sudo-rs-0.2.15_2
/usr/local/bin/sudo is provided by package sudo-sssd-1.9.17p2_5

It's especially painful with multiple jails.
The fetching of files.pkg should be optional, not default. Not everybody wants to look up files provided by remote packages.
 
I've just came across this today, while updating several low-performance VPS instances. It takes minutes per upgrade process to get the files compressed.

I couldn't find a flag or any reference towards changing this behaviour. Does anyone else have a hint for me whether this is intended?
 
From https://github.com/freebsd/pkg/releases/tag/2.8.2
rwhich
  • Store the filesite as a compressed archive parsed in memory, removing the
    pkg_files and file_dirs tables from the repo SQLite database (~96% of
    the DB size)

Does this mean one (also) looses the pkg info -l capability when disabling the rwhich database?

Also, am I assuming correctly that we reduced the size of the already present database (sqlite) by adding an *additional*, *compressed* database for the same feature? WHY?
 
  • Like
Reactions: dkh
It was certainly a very unwelcome surprise. It is very slow and gets repeated on every server. If it's telling us which files are available on the remote server why not make that a binary download as well instead of doing it locally. I must be missing something but this feels like something that only a few people are going to want so it shouldn't have been an auto opt in kind of thing.
 
Back
Top