Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Logging, backup and undo #311

infracaninophile opened this Issue · 1 comment

2 participants


Here's a nice-to-have idea.

  • Create a logging table in local.sqlite to record all actions that modify the locally installed package set
  • Any time a package is deleted or replaced, create a backup tarball and stash it away under /var/cache/pkg/backup
  • New commands pkg history and pkg undo
  • New config item: PKG_UNDO_LEVEL (integer) -- number of package history operations to be able to undo
  • Extend pkg clean to clear out old package backups according to PKG_UNDO_LEVEL

If we want to get fancy and crunch down on space usage, the backup package could contain just the files that differ between old and new versions.

More complex than it seems. If initially package bar-1.00 depends on foo-1.00, and after update we have bar-2.00 depends on foo-2.00, then reverting the foo-1.00 -> foo-2.00 update implies reverting the bar-1.00 to bar-2.00 update and vice-versa.


This is partially implemented by the pkg-plugins-zfssnap plugin which creates a ZFS snapshot before taking any install/deinstall actions.

On the other hand it would be really nice to have a native "history" command in pkg which does this.

The logging table could also be a separate sqlite db, e.g. /var/db/history.sqlite in order to keep the local.sqlite small in size for doing backups and restore for example.

Issue #359 probably could be implemented as part of this one as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.