Snap Revert Limits in KDE Neon: Unresolved Behavior After Failed Upgrade
0 reputation · 14 Oct 2023, 06:25 UTC
0 reputation · 14 Oct 2023, 06:25 UTC
When a Snap package upgrade fails on KDE Neon, the snap revert <package> command is the documented mechanism to return to a prior revision. However, the scope of what is actually undone—especially configuration files, system‑wide changes, and revision retention—has not been fully clarified.
snap revert, raising questions about comprehensive recovery.snap revert automatically restore configuration files that were altered by the newer revision, or must these be cleaned up manually?snap revert be used to roll back the kernel, or is a separate mechanism required?/var/snap//common) are preserved when you run snap revert. Any files the new revision wrote outside those directories—/etc, user home, or system‑wide units—are not automatically undone; you must delete or restore them manually.
refresh.retain in /etc/snapd/snapd.conf. You can view the current set with snap list --all.
snap revert only affects the snap package itself. A kernel updated by apt is outside snapd’s control, so it must be rolled back with the normal Debian kernel rollback path (apt, grub, systemd‑boot, etc.).snap list --all
Look for the revision and tracking‑channel columns. The row marked current is the one in use.
# Edit the snapd configuration
sudo nano /etc/snapd/snapd.conf
# Add or change the line
refresh.retain=5
# Restart snapd to apply the change
sudo systemctl restart snapd
After the restart, snap list --all will show up to five revisions per package.
sudo snap revert <package-name>
Verify that the snap’s files now match the earlier revision by inspecting /var/snap/<package-name>/current versus /var/snap/<package-name>/common.
Identify any files that the new revision created outside the snap’s data directory. Common locations include:
/etc/<package>~/.config/<package>/etc/systemd/systemRestore them from backup or delete them to match the state of the previous revision.
# List installed kernels
apt list --installed | grep linux-image
# Install the older kernel (replace old-version)
sudo apt install linux-image-old-version
# Update the boot loader and reboot
sudo update-grub
sudo reboot
After reboot, check that the snap is running the expected revision and that the kernel version matches your desired state. Test any affected services or user workflows to confirm recovery.
Could you confirm whether the configuration files that changed during the upgrade were stored inside the snap’s common directory or elsewhere (e.g., /etc or the user’s home)? Knowing that will help clarify whether any further manual cleanup is required.
Use comments to ask for clarification. Post a solution as an answer.
4,950 reputation · 14 Oct 2023, 15:04 UTC
Snap revert only swaps the read-only squashfs mount for the package back to a previous revision. The writable data directory under ~/snap// is not rolled back, so configuration files or state migrated by the newer revision remain in place after the revert.
This can leave the binary older while the data reflects the newer version, a common mismatch after a failed upgrade. Revision availability is governed by the system-wide refresh.retain setting, and snap list --all shows which revisions are actually present on the system.