Skip to content

An installation guide names a package, but your search returns nothing. Repeating the search cannot fix a missing local index. You need a sequence that distinguishes discovering software from changing the system.

By the end, you can follow one package from refreshed indexes through inspection, a reviewed installation, and verified removal. You can also examine pending upgrades without applying them.

Finish Packages, repositories, and dependencies. Use a disposable Ubuntu lab with internet access and your own sudo password. Work from ~/lab, created in the B04 setup. Package changes affect the system, regardless of the current directory.

The capture starts in a fresh container with empty APT indexes and neither sl nor libncurses6 installed. On your VM, first check their state with the query shown under Verify installed state. If either is already installed, use a disposable snapshot rather than later removing software you already had. Keep only the distribution’s configured repositories.

Network output was captured on 2026-11-15. Your versions, sizes, counts, mirror lines, and download speeds will differ. Judge the package names and kinds of change, not the captured totals.

The fresh lab’s first search prints no matches:

Terminal window
apt search '^sl$'
Captured output
Sorting... Done
Full Text Search... Done

The quoted regex matches the complete name sl; B10’s anchors keep unrelated names out. This result does not prove that the repository has no such package. The container image deliberately removes its cached indexes.

Authenticate sudo, then refresh those indexes:

Terminal window
sudo -v
sudo apt update

At the password prompt, type your own lab password and press Enter. Nothing appears while you type. sudo -v validates your authorization without launching another command; later sudo commands can reuse that authentication for a limited time.

Refresh empty indexes, then search
learner@rootvolt:~/lab$ sudo -v[sudo] password for learner: learner@rootvolt:~/lab$ sudo apt updateGet:1 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB]
Get:2 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Get:3 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Packages [2,211 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Get:5 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]
Get:6 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1,808 kB]
Get:7 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [1,557 kB]
Get:8 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [1,471 kB]
Get:9 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Packages [55.6 kB]
Get:10 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [19.3 MB]
Get:11 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [331 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble/restricted amd64 Packages [117 kB]
Get:13 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Packages [61.7 kB]
Get:14 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [2,179 kB]
Get:15 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages [2,324 kB]
Get:16 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1,792 kB]
Get:17 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 Packages [49.0 kB]
Get:18 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages [36.0 kB]
Get:19 http://archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Packages [669 B]
Fetched 33.9 MB in 5s (6,670 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
5 packages can be upgraded. Run 'apt list --upgradable' to see them.learner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. Authenticate without displaying the password, then download indexes from the configured Ubuntu repositories.
Steps (8)
  1. Type sudo -v
  2. Press Enter
  3. Output: [sudo] password for learner:
  4. Type the password (the terminal shows nothing)
  5. Press Enter — Type the password (not shown) and press Enter
  6. Type sudo apt update
  7. Press Enter
  8. Output: Get:1 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB] Get:2 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB] Get:3 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Packages [2,211 kB] Get:4 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB] Get:5 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB] Get:6 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1,808 kB] Get:7 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [1,557 kB] Get:8 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [1,471 kB] Get:9 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Packages [55.6 kB] Get:10 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [19.3 MB] Get:11 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [331 kB] Get:12 http://archive.ubuntu.com/ubuntu noble/restricted amd64 Packages [117 kB] Get:13 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Packages [61.7 kB] Get:14 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [2,179 kB] Get:15 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages [2,324 kB] Get:16 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1,792 kB] Get:17 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 Packages [49.0 kB] Get:18 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages [36.0 kB] Get:19 http://archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Packages [669 B] Fetched 33.9 MB in 5s (6,670 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 5 packages can be upgraded. Run 'apt list --upgradable' to see them.

apt update retrieves metadata. It does not upgrade the installed programs. Its final count reports available upgrades, which you will inspect separately. If repository downloads or authentication fail, stop here and resolve that failure before treating the local indexes as refreshed.

Search again, this time explicitly restricting matching to package names:

Terminal window
apt search --names-only '^sl$'
Search refreshed package indexes
learner@rootvolt:~/lab$ apt search --names-only '^sl$'Sorting... Done
Full Text Search... Done
sl/noble 5.02-1 amd64
  Correct you if you type `sl' by mistakelearner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. With populated indexes, the exact-name search finds the repository's sl package.
Steps (3)
  1. Type apt search --names-only '^sl$'
  2. Press Enter
  3. Output: Sorting... Done Full Text Search... Done sl/noble 5.02-1 amd64 Correct you if you type `sl' by mistake

The package description belongs to the repository. You do not need to run the animation to verify installation. In particular, sl and ls are different commands.

Terminal window
apt show sl
apt-cache depends sl
Inspect metadata and dependencies
learner@rootvolt:~/lab$ apt show slPackage: sl
Version: 5.02-1
Priority: optional
Section: universe/games
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Markus Frosch <lazyfrosch@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 60.4 kB
Depends: libc6 (>= 2.2.5), libncurses6 (>= 6), libtinfo6 (>= 6)
Homepage: https://github.com/mtoyoda/sl
Download-Size: 12.7 kB
APT-Sources: http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Description: Correct you if you type `sl' by mistakelearner@rootvolt:~/lab$ apt-cache depends slsl
  Depends: libc6
  Depends: libncurses6
  Depends: libtinfo6learner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. Inspect the offered version, source, size, description, and the three dependency names before making changes.
Steps (6)
  1. Type apt show sl
  2. Press Enter
  3. Output: Package: sl Version: 5.02-1 Priority: optional Section: universe/games Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Original-Maintainer: Markus Frosch <lazyfrosch@debian.org> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 60.4 kB Depends: libc6 (>= 2.2.5), libncurses6 (>= 6), libtinfo6 (>= 6) Homepage: https://github.com/mtoyoda/sl Download-Size: 12.7 kB APT-Sources: http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages Description: Correct you if you type `sl' by mistake
  4. Type apt-cache depends sl
  5. Press Enter
  6. Output: sl Depends: libc6 Depends: libncurses6 Depends: libtinfo6

apt show describes the offered package. Look for APT-Sources, Depends, and the two sizes. Download size is the archive transfer; installed size describes unpacked package storage. Neither is a promise about the total cost of all dependencies.

apt-cache depends gives a shorter relationship view. Here sl requires libc6, libncurses6, and libtinfo6. The plan below adds only one library because the other requirements are already satisfied. These inspection operations do not need sudo.

Read the confirmation before accepting a change

Section titled “Read the confirmation before accepting a change”

Predict first: will this install plan add all three dependencies, or only the missing one?

Terminal window
sudo apt install --assume-no sl
Run it, then compare with your guess
Review and decline the installation
learner@rootvolt:~/lab$ sudo apt install --assume-no slReading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libncurses6
The following NEW packages will be installed:
  libncurses6 sl
0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded.
Need to get 125 kB of archives.
After this operation, 404 kB of additional disk space will be used.
Do you want to continue? [Y/n] N
Abort.learner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. The plan adds sl and libncurses6, then answers its confirmation with N and aborts without installing them.
Steps (3)
  1. Type sudo apt install --assume-no sl
  2. Press Enter
  3. Output: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libncurses6 The following NEW packages will be installed: libncurses6 sl 0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded. Need to get 125 kB of archives. After this operation, 404 kB of additional disk space will be used. Do you want to continue? [Y/n] N Abort.

Only libncurses6 is additional in this lab. Read the summary’s upgraded, newly installed, removed, and not upgraded categories separately. --assume-no automatically declines the confirmation. The resulting Abort. and status 1 are intentional, not a broken installation.

An ordinary sudo apt install sl pauses at this same confirmation. Read the list, then type y only if you intend every proposed change; n cancels. APT can sometimes complete operations without asking, so a review command is useful before a change.

For this bounded recording, the next command uses --yes after the plan has been checked. It automatically accepts confirmation. Do not copy that option into an unfamiliar installation or an upgrade. Recheck if the package list or repository state changes between review and execution.

Terminal window
sudo apt install --yes -o Dpkg::Progress-Fancy=0 sl

-o Dpkg::Progress-Fancy=0 disables APT’s terminal progress drawing so the recorded output remains plain text. It does not change package selection or bypass repository authentication. You can omit that display setting in an ordinary terminal.

Use Debian’s package query tool to check the actual state, then ask which package supplied the executable:

Terminal window
dpkg-query -W -f='${Package} ${Status}\n' sl libncurses6
dpkg -S /usr/games/sl
Install the reviewed package and dependency
learner@rootvolt:~/lab$ sudo apt install --yes -o Dpkg::Progress-Fancy=0 slReading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libncurses6
The following NEW packages will be installed:
  libncurses6 sl
0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded.
Need to get 125 kB of archives.
After this operation, 404 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libncurses6 amd64 6.4+20240113-1ubuntu2.2 [112 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble/universe amd64 sl amd64 5.02-1 [12.7 kB]
Fetched 125 kB in 1s (83.8 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libncurses6:amd64.
(Reading database ... 11321 files and directories currently installed.)
Preparing to unpack .../libncurses6_6.4+20240113-1ubuntu2.2_amd64.deb ...
Unpacking libncurses6:amd64 (6.4+20240113-1ubuntu2.2) ...
Selecting previously unselected package sl.
Preparing to unpack .../archives/sl_5.02-1_amd64.deb ...
Unpacking sl (5.02-1) ...
Setting up libncurses6:amd64 (6.4+20240113-1ubuntu2.2) ...
Setting up sl (5.02-1) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.9) ...learner@rootvolt:~/lab$ dpkg-query -W -f='${Package} ${Status}\n' sl libncurses6libncurses6 install ok installed
sl install ok installedlearner@rootvolt:~/lab$ dpkg -S /usr/games/slsl: /usr/games/sllearner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. Install the reviewed pair, verify install ok installed for each, and identify the package owning /usr/games/sl.
Steps (9)
  1. Type sudo apt install --yes -o Dpkg::Progress-Fancy=0 sl
  2. Press Enter
  3. Output: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libncurses6 The following NEW packages will be installed: libncurses6 sl 0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded. Need to get 125 kB of archives. After this operation, 404 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libncurses6 amd64 6.4+20240113-1ubuntu2.2 [112 kB] Get:2 http://archive.ubuntu.com/ubuntu noble/universe amd64 sl amd64 5.02-1 [12.7 kB] Fetched 125 kB in 1s (83.8 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libncurses6:amd64. (Reading database ... 11321 files and directories currently installed.) Preparing to unpack .../libncurses6_6.4+20240113-1ubuntu2.2_amd64.deb ... Unpacking libncurses6:amd64 (6.4+20240113-1ubuntu2.2) ... Selecting previously unselected package sl. Preparing to unpack .../archives/sl_5.02-1_amd64.deb ... Unpacking sl (5.02-1) ... Setting up libncurses6:amd64 (6.4+20240113-1ubuntu2.2) ... Setting up sl (5.02-1) ... Processing triggers for man-db (2.12.0-4build2) ... Processing triggers for libc-bin (2.39-0ubuntu8.9) ...
  4. Type dpkg-query -W -f='${Package} ${Status}\n' sl libncurses6
  5. Press Enter
  6. Output: libncurses6 install ok installed sl install ok installed
  7. Type dpkg -S /usr/games/sl
  8. Press Enter
  9. Output: sl: /usr/games/sl

-W asks for package records; -f selects a format. Single quotes preserve the field expressions for dpkg-query instead of expanding them in Bash. install ok installed establishes installed state. A repository search alone could not do that. dpkg -S searches installed file ownership; it does not search remote repository contents.

The capture retains the container’s apt-utils diagnostic. This diagnostic reflects optional tooling absent from the container; both package records and the command’s successful exit verify completion. Do not mistake that diagnostic alone for a failed installation.

Terminal window
apt list --upgradable
sudo apt upgrade --assume-no
Review installed upgrades without applying them
learner@rootvolt:~/lab$ apt list --upgradableListing... Done
ca-certificates/noble-updates,noble-security 20260816ubuntu0.24.04.2 all [upgradable from: 20260816ubuntu0.24.04.1]
libc-bin/noble-updates,noble-security 2.39-0ubuntu8.12 amd64 [upgradable from: 2.39-0ubuntu8.9]
libc6/noble-updates,noble-security 2.39-0ubuntu8.12 amd64 [upgradable from: 2.39-0ubuntu8.9]
locales/noble-updates,noble-security 2.39-0ubuntu8.12 all [upgradable from: 2.39-0ubuntu8.9]
perl-base/noble-updates,noble-security 5.38.2-3.2ubuntu0.7 amd64 [upgradable from: 5.38.2-3.2ubuntu0.6]learner@rootvolt:~/lab$ sudo apt upgrade --assume-noReading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  ca-certificates libc-bin libc6 locales perl-base
5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.1 MB of archives.
After this operation, 2,048 B of additional disk space will be used.
Do you want to continue? [Y/n] N
Abort.learner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. List pending installed-package upgrades and inspect their plan, then decline the confirmation.
Steps (6)
  1. Type apt list --upgradable
  2. Press Enter
  3. Output: Listing... Done ca-certificates/noble-updates,noble-security 20260816ubuntu0.24.04.2 all [upgradable from: 20260816ubuntu0.24.04.1] libc-bin/noble-updates,noble-security 2.39-0ubuntu8.12 amd64 [upgradable from: 2.39-0ubuntu8.9] libc6/noble-updates,noble-security 2.39-0ubuntu8.12 amd64 [upgradable from: 2.39-0ubuntu8.9] locales/noble-updates,noble-security 2.39-0ubuntu8.12 all [upgradable from: 2.39-0ubuntu8.9] perl-base/noble-updates,noble-security 5.38.2-3.2ubuntu0.7 amd64 [upgradable from: 5.38.2-3.2ubuntu0.6]
  4. Type sudo apt upgrade --assume-no
  5. Press Enter
  6. Output: Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: ca-certificates libc-bin libc6 locales perl-base 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 10.1 MB of archives. After this operation, 2,048 B of additional disk space will be used. Do you want to continue? [Y/n] N Abort.

apt upgrade would replace installed packages with available versions, adding dependencies if needed. It does not remove installed packages to complete an upgrade. Here the plan concerns other installed software, not installing more copies of sl. Nothing is upgraded in this recording.

Review the affected packages and arrange time for restarts before applying an upgrade on a real machine. The container has no running systemd and cannot demonstrate service-restart prompts. The following lesson separates those operations in detail.

Omitting sudo for an installation. The captured unprivileged attempt is:

Terminal window
apt install sl
Captured output
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

This particular message says permission was denied. Use your authorized sudo operation. A lock held by another package manager is a different situation: wait for that operation, rather than deleting lock files.

Reading a declined plan as a failed download. Abort. after --assume-no is expected. No package archives were installed by that plan.

Goal: After completing the reset below, prove that repository metadata can still describe sl even though its installed record is gone. Display only its name, dependencies, and description.

Hint

Compare an installed-record query with apt show. B10’s extended grep can select several field names with alternatives.

Solution
Terminal window
dpkg-query -W -f='${Package}: ${Status}\n' sl libncurses6
apt show sl | grep -E '^(Package|Depends|Description):'

The query reports no matching installed package records after the reset. The filtered metadata still describes sl and its dependencies. Piping apt also prints a warning that its CLI is not stable for scripts; these are interactive learning commands. Use purpose-built query tools for automation.

Review the requested package’s removal, then remove it only if you installed it for this exercise:

Terminal window
sudo apt remove --assume-no sl
sudo apt remove --yes -o Dpkg::Progress-Fancy=0 sl
Remove the requested package
learner@rootvolt:~/lab$ sudo apt remove --assume-no slReading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  libncurses6
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
  sl
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
After this operation, 60.4 kB disk space will be freed.
Do you want to continue? [Y/n] N
Abort.learner@rootvolt:~/lab$ sudo apt remove --yes -o Dpkg::Progress-Fancy=0 slReading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  libncurses6
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
  sl
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
After this operation, 60.4 kB disk space will be freed.
(Reading database ... 11353 files and directories currently installed.)
Removing sl (5.02-1) ...
Processing triggers for man-db (2.12.0-4build2) ...learner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. Decline a removal plan first, then remove only sl; its automatically installed library remains.
Steps (6)
  1. Type sudo apt remove --assume-no sl
  2. Press Enter
  3. Output: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libncurses6 Use 'sudo apt autoremove' to remove it. The following packages will be REMOVED: sl 0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded. After this operation, 60.4 kB disk space will be freed. Do you want to continue? [Y/n] N Abort.
  4. Type sudo apt remove --yes -o Dpkg::Progress-Fancy=0 sl
  5. Press Enter
  6. Output: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libncurses6 Use 'sudo apt autoremove' to remove it. The following packages will be REMOVED: sl 0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded. After this operation, 60.4 kB disk space will be freed. (Reading database ... 11353 files and directories currently installed.) Removing sl (5.02-1) ... Processing triggers for man-db (2.12.0-4build2) ...

Now review unused automatically installed packages:

Terminal window
sudo apt autoremove --assume-no

Only for that reviewed lab-only plan:

Terminal window
sudo apt autoremove --yes -o Dpkg::Progress-Fancy=0
Review and remove only the unused lab dependency
learner@rootvolt:~/lab$ sudo apt autoremove --assume-noReading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  libncurses6
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
After this operation, 344 kB disk space will be freed.
Do you want to continue? [Y/n] N
Abort.learner@rootvolt:~/lab$ sudo apt autoremove --yes -o Dpkg::Progress-Fancy=0Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  libncurses6
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
After this operation, 344 kB disk space will be freed.
(Reading database ... 11330 files and directories currently installed.)
Removing libncurses6:amd64 (6.4+20240113-1ubuntu2.2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.9) ...learner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. The cleanup plan contains only libncurses6; removing it restores the initial installed-package set.
Steps (6)
  1. Type sudo apt autoremove --assume-no
  2. Press Enter
  3. Output: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: libncurses6 0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded. After this operation, 344 kB disk space will be freed. Do you want to continue? [Y/n] N Abort.
  4. Type sudo apt autoremove --yes -o Dpkg::Progress-Fancy=0
  5. Press Enter
  6. Output: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: libncurses6 0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded. After this operation, 344 kB disk space will be freed. (Reading database ... 11330 files and directories currently installed.) Removing libncurses6:amd64 (6.4+20240113-1ubuntu2.2) ... Processing triggers for libc-bin (2.39-0ubuntu8.9) ...

Repeat the query from the challenge to establish both records are absent. Indexes remain refreshed; the reset restores the installed package set, not the old metadata cache. remove may retain package configuration, while purge also removes package-managed configuration. Neither package leaves a residual record in this capture, so no purge is needed here.

  • Refresh indexes, search, and inspect before changing installed software.
  • Read dependencies and every change category in the confirmation summary.
  • Verify installed state independently of repository search results.
  • Review upgrades without applying them, and review cleanup before removing unused dependencies.

Next, Understanding update terminology separates index refreshes, package upgrades, release migrations, and restarts.