Chapter 05 of 17
Administer a distribution
Use privilege and package managers deliberately, with a recovery plan.
The mental model.
sudo runs an allowed command as another user, usually root, under an administrator-defined policy. su changes user context. Work as a regular user and elevate only the action that needs it; root privileges do not make a command correct.
APT is common on Debian and Ubuntu, while DNF is common on Fedora. apt update refreshes repository metadata; apt upgrade installs available upgrades. dpkg and rpm inspect or install local package files but do not provide the same repository dependency workflow.
Prefer signed distribution repositories. Check package names, dependencies, and proposed removals before accepting changes. Downloading a script and piping it directly into a privileged shell gives that script full control of the machine.
Record configuration before changing it. Keep an open administrative session when changing remote access, and verify a new session works before closing the old one. Use a VM snapshot for experiments that could prevent boot or login.
Read it. Predict it. Try it.
Before running these commands, predict what each line will change or print. Launch a quest below to open the simulated terminal.
apt --help
sudo apt update
sudo apt install tree
tree /home/learnerIn the simulator, installation changes a model. In a real disposable Debian/Ubuntu VM, review the package manager’s plan and verify the installed program.
Check your understanding
Explain the why.
Put it into practice.
Complete the exercises, then try the Boss Challenge without hints. Each quest checks its own objectives. You can revisit this chapter at any time.
Make the learning stick.
Close the explanation and describe the main idea in your own words. Change a filename or input and predict the outcome. Tomorrow, repeat a quest without hints. Then apply it in a disposable real Linux environment.
Open the real-system labs →