Automatic filesystem snapshots for DNF5 package transactions using Snapper.
This plugin creates before/after snapshots of your system when installing, upgrading, or removing packages with DNF5, giving you an easy rollback option if something goes wrong.
- Safety Net: Automatically snapshot your system before risky upgrades
- Easy Rollback: Undo problematic package changes with Snapper's rollback
- Smart Filtering: Only snapshot when important packages change (kernel, systemd, etc.)
- Fast & Native: Uses libsnapper API directly, works in rescue mode
- DNF5 Ready: Modern replacement for the old python3-dnf-plugin-snapper
From GitHub Releases:
# Download the latest RPM from GitHub releases
wget https://github.com/Plenvorik/libdnf5-plugin-snapper/releases/latest/download/libdnf5-plugin-snapper-*.rpm
# Install
sudo dnf install ./libdnf5-plugin-snapper-*.rpmFrom Source:
git clone https://github.com/Plenvorik/libdnf5-plugin-snapper.git
cd libdnf5-plugin-snapper
mkdir build && cd build
cmake ..
make
sudo make installOnce installed, the plugin works automatically:
# Install a package - snapshots created automatically
sudo dnf install kernel
# Check your snapshots
sudo snapper list
# Rollback if needed
sudo snapper rollback <snapshot-number>Edit /etc/dnf/libdnf5-plugins/snapper.conf to customize:
[main]
enabled = true
snapper_config = root
cleanup_algorithm = number
[filters]
# Snapshot only for important packages (recommended)
include_packages = *
important_packages = kernel-*, systemd*, grub2-*, glibc*- Pre-Transaction: Plugin checks if transaction affects filtered packages
- Snapshot Created: If yes, creates a "pre" snapshot before changes
- Transaction Runs: DNF installs/removes packages normally
- Post-Snapshot: Creates paired "post" snapshot after success
- Metadata Stored: Transaction details saved for later reference
Contributions welcome! Here's how to get involved:
Found a bug? Open an issue with:
- Your Fedora version
- Steps to reproduce
- Expected vs actual behavior
- Output from
dnf -v install <package>
- Fork the repository
- Create a feature branch (
git checkout -b feature/awesome-improvement) - Make your changes (follow existing code style)
- Run tests:
ctestin build directory - Commit with clear message
- Push and open a pull request
# Install dependencies
sudo dnf install cmake gcc-c++ libdnf5-devel snapper-devel boost-devel fmt-devel catch2-devel
# Build with tests
cmake -B build -DENABLE_TESTS=ON
cmake --build build
# Run tests
cd build && ctest --verbose- Fedora 41-43 or compatible distribution with DNF5
- Snapper >= 0.10 with configured snapshot configuration
- Btrfs filesystem (or other filesystem supported by Snapper)
This plugin replaces the older python3-dnf-plugin-snapper for DNF4. Configuration format is compatible but uses enhanced INI syntax.
LGPL-2.1-or-later - see COPYING for details.
- Andre Herrlich - Current maintainer - @Plenvorik
- Based on original dnf-plugin-snapper by Igor Gnatenko (2014)