0
0
Linux CLIscripting~10 mins

apt (Debian/Ubuntu) basics in Linux CLI - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - apt (Debian/Ubuntu) basics
Start
Update package list
Search for package
Install package
Remove package
Upgrade packages
End
This flow shows the common steps when using apt: update package info, search, install, remove, and upgrade.
Execution Sample
Linux CLI
sudo apt update
apt search curl
sudo apt install curl
apt list --installed | grep curl
sudo apt remove curl
This script updates package info, searches for curl, installs it, checks if installed, then removes it.
Execution Table
StepCommandActionOutput Summary
1sudo apt updateRefresh package lists from repositoriesLists updated successfully
2apt search curlSearch for packages matching 'curl'Shows curl package info
3sudo apt install curlInstall curl packagecurl installed or already installed
4apt list --installed | grep curlCheck if curl is installedShows curl in installed list
5sudo apt remove curlRemove curl packagecurl removed or not installed
💡 All commands executed in sequence to manage the curl package.
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5
Package ListOldUpdatedUpdatedUpdatedUpdatedUpdated
curl Package StatusNot installedNot installedAvailableInstalledInstalledRemoved
Key Moments - 3 Insights
Why do we run 'sudo apt update' before installing packages?
Because 'apt update' refreshes the list of available packages and versions. Without it, apt might try to install outdated or missing packages. See execution_table step 1.
What does 'apt search curl' show if curl is not installed?
It shows information about the curl package available in repositories, not whether it is installed. See execution_table step 2.
Does 'apt remove curl' delete configuration files?
No, 'apt remove' removes the package but keeps config files. To remove configs, use 'apt purge'. See execution_table step 5.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the package status after step 3?
AInstalled
BNot installed
CRemoved
DUnknown
💡 Hint
Check variable_tracker row 'curl Package Status' after Step 3.
At which step does the package list get updated?
AStep 2
BStep 1
CStep 4
DStep 5
💡 Hint
See execution_table step 1 description.
If you skip 'sudo apt update', what might happen when installing?
AInstallation uses outdated package info
BInstallation is faster and safer
CPackage is removed instead
DNothing changes
💡 Hint
Refer to key_moments about why 'apt update' is important.
Concept Snapshot
apt basics commands:
- sudo apt update: refresh package info
- apt search <pkg>: find packages
- sudo apt install <pkg>: install package
- apt list --installed: list installed
- sudo apt remove <pkg>: uninstall package
Always update before install.
Full Transcript
This lesson shows how to use apt on Debian/Ubuntu. First, run 'sudo apt update' to refresh package lists. Then use 'apt search' to find packages. Install with 'sudo apt install'. Check installed packages with 'apt list --installed'. Remove packages with 'sudo apt remove'. Updating first ensures you get the latest package info. Removing keeps config files unless you purge. This step-by-step helps beginners see how apt commands change system state.