M37 - Package Management: CLI

Use command-line package managers to search, install, update, and remove software more consistently and with better automation potential.

Software

Package Management: CLI

Use command-line package managers to search, install, update, and remove software more consistently and with better automation potential.

40 min INTERMEDIATE BOTH
What you should learn
  • Use command-line package managers to search, install, update, and remove software more consistently and with better automation potential.
Visual model

Concept to practice path

Each lesson is meant to move from an idea, to an example, to a safe practice step.

Why This Matters

The CLI package workflow is valuable because it is:

  • faster for repeated tasks
  • easier to document
  • easier to automate
  • clearer about what was installed and how

But speed should not turn into carelessness.


1. Search First

Before installing, confirm the package name and source as clearly as you can.

Search with winget

winget search Python

Search with apt

apt search python3

This helps reduce mistakes such as choosing the wrong package or assuming a package name that does not exist.


2. Understand Update Versus Install

On Linux in particular, updating package metadata and installing software are not the same step.

Install and Upgrade with winget

winget install Git.Git winget upgrade --all

Metadata and Install with apt

sudo apt update sudo apt install git sudo apt upgrade

That distinction matters because good package habits depend on knowing what each command is actually doing.


3. Removal Is Also Part of Management

A package manager is not only for installation.

It also gives you a more structured way to remove software later.

That matters because clean removal is part of system maintenance, not an afterthought.

Better Habit

Search first, install deliberately, update through the same system, and remove through the same system. That is a healthier software-management loop than one-off installers scattered across the machine.


What to Ignore for Now

  • third-party package feed management in depth
  • package pinning and version locks
  • advanced dependency debugging

The goal here is a clean day-to-day package workflow.


Before You Move On

You are ready for the software lab when you can:

  1. search for a package
  2. explain update versus install
  3. explain why CLI package tools are better for repeatable setup

Next, we use that workflow to build a small toolkit in a more deliberate way.

Learning loop

Recall it, check it, then practice it.

Do this before moving on. It turns reading into memory and safer action.

Recall
  • Why is a package-manager command easier to automate than a manual installer workflow?
  • Why should you search and verify a package name before installing or removing it?
Check
  • Use a package manager to search for a package without notes.
  • Explain the difference between updating package metadata and installing a package.

What to do next

Best next step Practice

Use the matching lab or keep building skill in practice.

Open now