Make sure your system is updated and that you have a Btrfs or LVM with thin provisioning filesystem.
Check your filesystem type:
sudo btrfs subvolume list /
Update your system and install EPEL repository:
sudo dnf update -y
sudo dnf install epel-release -y
Snapper has several library dependencies. Install the C++ toolchain and the required development headers:
sudo dnf install -y \
git \
make \
autoconf \
automake \
libtool \
gcc-c++ \
boost-devel \
dbus-devel \
libxml2-devel \
libmount-devel \
libacl-devel \
btrfs-progs-devel \
json-c-devel \
ncurses-devel \
pam-devel \
gettext-devel \
docbook-style-xsl \
libxslt \
pkgconf-pkg-config
git clone https://github.com/openSUSE/snapper.git
cd snapper
make -f Makefile.repo
./configure --prefix=/usr --sysconfdir=/etc/sysconfig/snapper
make -j$(nproc)
sudo make install
sudo systemctl enable --now snapper-timeline.timer
sudo systemctl enable --now snapper-cleanup.timer
Copy the default config template and edit it:
sudo cp /usr/share/snapper/config-templates/default /etc/snapper/configs/root
Check to see if the config file copied:
sudo vi /etc/snapper/configs/root
Create the snapshots directory:
sudo rm -rf /.snapshots
sudo btrfs subvolume create /.snapshots
Create /etc/sysconfig/snapper and add the config line below:
sudo vi /etc/sysconfig/snapper
SNAPPER_CONFIGS="root"
For more configuration options, see the snapper-configs manual page.
Label the Snapper binaries, configs, and snapshots directory:
sudo restorecon -Rv /usr/sbin/snapperd
sudo restorecon -Rv /etc/snapper
sudo restorecon -Rv /.snapshots
Check that Snapper is working correctly:
sudo snapper list-configs
sudo snapper -c root list
Thanks to Andrey Smirnov for packaging Snapper for AlmaLinux 10.1, which can be found here Snapper for AlmaLinux 10.1
Coming soon...