Re: Suggestion for speeding up pkg

From: Jan Bramkamp <crest_at_rlwinm.de>
Date: Tue, 27 Jun 2023 09:09:54 UTC
On 08.06.23 03:50, Patrick McMunn wrote:
> I'm just a regular user of FreeBSD, but I'd like to make a suggestion. 
> When installing a large set of packages, such as "pkg install kde5", 
> it can take quite a while to download all that data. Why does pkg 
> download ALL the packages and only then begin to extract and install 
> them? Would it not be a more efficient use of time to calculate 
> dependencies first, then begin downloading the packages in the order 
> in which they are required, and then begin extracting and installing 
> them as they are downloaded instead of waiting for the download to 
> complete before beginning installation?
>
> I understand that part of the reason is verification and such, but the 
> default could be extracting and installing to a temporary directory 
> then merging to the live system once everything is downloaded and 
> extracted. Make the behavior configurable by the user. Set sane 
> defaults. Check for sufficient disk space immediately after dependency 
> calculation to make sure space is available for the downloads, the 
> extracted contents, and any other necessities. This will make for a 
> more pleasant user experience.
You just dismissed multiple new failure cases that could leave users 
stuck with a partly upgraded system. In my opinion fetching the latest 
version of all packages is the right thing to do, but the public package 
mirrors are painfully slow for some users. How are you fetching your 
packages? What transfer speeds are did you encounter? How long did 
fetching all dependencies take?