You need to install packages on a server temporarily for debugging, and remove them all afterwards. How do you keep it clean?
IntermediateScenarioPackages, kernel and boot
Answer
Situation read → Track the transaction so you can undo it.
What I'd do →
- RHEL: install, then
dnf history undo last(or the transaction ID) when done. - Ubuntu:
apt install strace tcpdump, thenapt purge strace tcpdump && apt autoremove. - Best: use a debug container sharing namespaces (
nsenter, ortoolboxon Fedora/RHEL) so the host stays clean.
Why → Debug tools left on production widen the attack surface and drift from the baseline.
Interview tip → Mention immutable hosts where you never install anything, only redeploy.
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