You need to roll back a whole server to its state before a risky change, not just one package. What can you use?
AdvancedScenarioPackages, kernel and boot
Answer
Situation read → Filesystem or volume snapshots.
What I'd do →
- Cloud: snapshot the volume (or AMI) before the change; restore by creating a volume from it.
- LVM:
lvcreate -s -n root_pre -L 10G /dev/vg0/root; to roll back,lvconvert --merge /dev/vg0/root_preand reboot. - Btrfs/Snapper (SUSE, Fedora):
snapper create, thensnapper rollback. - For VMs: hypervisor snapshot, deleted after the change succeeds.
Why → One step returns OS, config and packages to a known state.
Interview tip → Snapshots aren't backups; delete them after the change because they hurt performance and fill.
More on Packages, kernel and boot
You must upgrade the kernel on 50 production servers and be able to roll back if the new kernel misbehaves. Plan it.AdvancedYou need to pin a package version so routine updates don't upgrade it (e.g. Docker or PostgreSQL). How?BeginnerA package update broke an application. How do you roll it back?IntermediateYour servers can't reach the internet but need packages. How do you provide repositories?IntermediateYou need to compile and install software from source on a server that also uses packages. How do you avoid making a mess?IntermediateYou need to change kernel boot parameters (e.g. add `transparent_hugepage=never`) persistently. How?Intermediate