Interview Prep/Linux/Packages, kernel and boot

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, then apt purge strace tcpdump && apt autoremove.
  • Best: use a debug container sharing namespaces (nsenter, or toolbox on 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.

All Linux questions Roadmap: Linux

More on Packages, kernel and boot