wEEK 12

Software Management

This week focuses on how Linux manages software packages—the modular building blocks of any system. Every command you’ve used so far came from a package managed by a tool called APT (Advanced Package Tool).
APT handles three critical jobs:

  1. It keeps a catalog of available software (the package index).

  2. It installs and removes packages with all their dependencies.

  3. It helps users inspect and explore what’s already on the system.

In this lesson, you’ll learn to use the APT package manager, following the six-step M-A-N-A-G-E framework.

M-A-N-A-G-E (Manage → Ask → Name → Add → Get rid → Explore).

M — Manage Package Index

APT maintains a local index of available packages. This index must be refreshed frequently to ensure your system knows about the latest software, security patches, and updates.

CommandPurposeDescription
sudo apt-get updateRefresh package listSynchronizes your local repository index with online sources.
sudo apt-get upgradeApply safe upgradesUpdates all installed packages to their newest compatible versions.
sudo apt-get dist-upgradeFull distribution upgradeHandles kernel or dependency changes that require more complex updates.
sudo apt-get autocleanClean cacheRemoves old, unused package files from /var/cache/apt/archives.
sudo apt-get autoremoveRemove orphansDeletes libraries and packages that were automatically installed but are no longer needed.

Updating the index keeps your system aware of available software versions—much like refreshing an app store before installing anything.

 
 

A — Ask About Packages

APT can search for software without installing it. This allows you to explore available tools safely and see what’s maintained in your repositories.

CommandPurposeDescription
apt-cache search gitSearch repositoryFinds packages related to a keyword such as “git.”
apt search editorModern searchA cleaner, user-friendly search interface.
apt-cache showpkg nginxShow relationshipsDisplays dependency and reverse dependency information.
apt-cache policy curlCheck version sourceShows which repository a package comes from and available versions.

Searching lets you “ask” the system what software exists. It encourages exploration before committing to install anything.

 

N — Name Details

Before installing a package, you should know exactly what it is. APT and dpkg provide detailed metadata that describes each package’s role, dependencies, and maintainers.

 
CommandPurposeDescription
apt show gitDisplay package infoShows full description, dependencies, version, and maintainer.
dpkg -s bashCheck installed packageDisplays local metadata for already installed software.
apt-cache depends gitShow dependenciesLists other packages required for operation.
apt-cache rdepends gitShow reverse dependenciesDisplays which packages depend on it.

Reading package details helps you understand what’s being installed and ensures you don’t remove something critical to the system.

 

Navigate the tree​

A — Add Software (Safe Install)

Installation through APT is reliable because it resolves dependencies automatically and verifies digital signatures.

CommandPurposeDescription
sudo apt-get install -y treeInstall packageDownloads and installs “tree” without confirmation prompts.
sudo apt-get install -y htop curlInstall multipleInstalls more than one package at the same time.
sudo apt-get install --reinstall -y treeReinstallReinstalls a package if it’s corrupted.
tree --versionVerify versionConfirms that the software was successfully installed.
which treeLocate binaryShows the installation path of the command (usually /usr/bin/tree).

Adding software expands your environment safely. APT checks authenticity, integrity, and dependencies automatically.

 

G — Get Rid of It

Removing software cleanly is as important as installing it. Proper removal helps keep your system lean and avoids conflicts or wasted space.

CommandPurposeDescription
sudo apt-get remove -y treeUninstallRemoves program files but leaves configuration data intact.
sudo apt-get purge -y treeFull removalDeletes both the program and its configuration files.
sudo apt-get autoremove -yDependency cleanupRemoves leftover dependencies that are no longer needed.
sudo apt-get cleanClear cacheDeletes downloaded package files from the local cache.
dpkg -l | grep treeVerify removalChecks if the package is still listed as installed.
 
System hygiene prevents unnecessary storage use and reduces the chance of conflicts during future updates. 

E — Explore Installed Packages

APT tracks every installed package, creating a transparent record of your system’s contents. Exploring this list helps you understand how your environment is built.

CommandPurposeDescription
apt list --installed | lessView installed packagesDisplays all installed packages with scrolling navigation.
dpkg -lLocal package listPrints a concise summary of installed packages.
dpkg -L bashList package filesShows every file installed by a package.
dpkg -S /usr/bin/lsIdentify package by fileFinds which package owns a particular file.
apt-mark showmanualUser-installed listLists packages that were installed manually.
apt-mark showautoAuto-installed listLists packages installed automatically as dependencies.
 
Exploring your installed packages helps with auditing, debugging, and system optimization. You’ll see Linux as a layered ecosystem rather than a black box.
 

This concludes Lecture 12. Please return to Blackboard to access the Week 12 materials.

Scroll to Top