How Do I Get DNF to Work with Snapper?

I just installed Fedora 43 KDE Plasma, and I’d like to get dnf to work with snapper.

From searching around, I figure this requires me to install snapper–which wasn’t included in the default installation–and python3-dnf-plugin-snapper, which I’ve done.

I enabled the cleanup and timeline services:

sudo systemctl enable --now snapper-cleanup.timer
sudo systemctl enable --now snapper-timeline.timer

I created the default root config:

sudo snapper -c root create-config /

and then I checked the configuration file for snapper:

cat /etc/dnf/plugins/snapper.conf

which shows:

[main]
enabled = 1
snapper_config = root

I checked /etc/dnf/dnf.conf and verified that there’s a line in there:

plugins=1

(There wasn’t, so I added it.)

After all that, snapper still wasn’t working after a dnf command, and the snapper logs showed this:

2026-02-08 12:52:16 WAR libsnapper(32300) FileUtils.cc(SDir):88 - THROW: open failed path://.snapshots/2 errno:2 (No such file or directory)

I ended up mounting /.snapshots in my /etc/fstab:

/dev/mapper/luks-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX /.snapshots  btrfs  subvolid=258,defaults 0 0

which got rid of the directory not found errors, but snapper is still not run when I run a dnf command.

I can create a snapshot manually, so snapper now appears to be working, it just doesn’t work with dnf.

What am I missing? And, even if I get this working, with Fedora 43, am I going to be able to boot into the saved snapshots?

This is for dnf4, not dnf5.

I don’t see a dnf5 plugin for that, but you can do what you want with
the libdnf5-actions plugin (RPM: libdnf5-plugin-actions)

Install it and follow the man libdnf5-actions.

AFAIK yes, eventually with some scripting. I read some post about that. Not in mood to
retreive it at the moment. :frowning:

This thread has an example of a snapper.actions file to work with the libdnf5-actions plugin:

See for example: Make use of Btrfs snapshots to upgrade Fedora Linux with easy fallback - Fedora Magazine

Thanks to all of you for taking the time to respond.

My goal is to have the cleanest installation I can have so that when it comes time to do a system upgrade, it will go smoothly. I think setting this up adds some unnecessary complexity for me since I have a good system of rsync backups of my home folder in place; if an upgrade goes bad and I can’t fix it, a clean install would be relatively painless.

Maybe the devs will include it by default down the road…

Similar topic with scripting examples… Getting snapper/btrfs-assistant to work with dnf5 - #11 by ksvist

1 Like

Isn’t there still a limitation that since snapshots are a btrfs thing, so they only snapshot your btrfs subvolumes, and usually /boot and /boot/efi are other partition types so they are not included in your snapshots. My fairly default install has /boot/efi as vfat/FAT32 and /boot as ext4. Since the kernels, initramfs, etc. are stored in /boot those would not be included in your snapshots, so you may not be able to boot back into a known good configuration. I know resolving this and allowing full rollback is a very desired capability, I don’t believe we’re there yet in Fedora. I believe Tumbleweed does have this capability.