Ricardo Wurmus <rek...@elephly.net> skribis:

> Dika Setya Prayogi <dikasetyapray...@gmail.com> writes:

[...]

>> 2.set auto garbage collect for package old than one month
>
> Garbage collection is not about age but about references.  If a package
> is referenced in a profile (even if it’s not the latest generation of
> the profile) it won’t be collected.  This is a feature.
>
> To achieve garbage collection of old packages you would have to remove
> all old profile generations (so that older packages are no longer
> referenced), and also make sure that no “old” packages are referenced in
> the current profile generation.  This essentially requires a forced
> upgrade with deletion of older profile generations, which seems quite
> unwise.  You’d throw away some of the best features of Guix, in my
> opinion.

One could have a periodic job that runs:

  guix package --delete-generations=1m && guix gc

This removes generations older than 1 month and then runs the GC.

Depending on your use case, this may or may not be a good idea.  I
personally prefer to remove generations once I know I’m very unlikely to
ever need to roll back to them.

Ludo’.

Reply via email to