Skip to content

Practice: Installing Software

Module
Installing Software
Difficulty
Easy
Updated
Tested on
Ubuntu 24.04.5 LTS (lab container), GNU Bash 5.2.21
On this page

A teammate needs evidence that a temporary tool was installed from the lab’s configured sources and then removed. A screenshot of a search result cannot establish either fact. Your handoff must distinguish available metadata, installed state, managed files, and the final reset.

This practice combines B12.1–B12.4. Use the lessons and manuals as needed. You are auditing a small installation, not upgrading the whole machine or changing repositories.

Finish APT everyday operations through Recognizing distribution differences, including B12.2’s reset. Work in a disposable Ubuntu lab with internet access, your own sudo password, and the B04 lab directory. The working directory is ~/lab; the package changes are system-wide.

Use the same bounded package, sl, so cleanup has a known scope. Establish first that neither sl nor libncurses6 is installed:

Terminal window
dpkg-query -W -f='${Package} ${Status}\n' sl libncurses6

In the fresh capture, both lookups report no matching packages and the query returns status 1. If either package already belongs to your VM’s baseline, use a disposable snapshot with the exercise’s initial state. Do not remove pre-existing software to imitate this capture.

The network recording was captured on 2026-11-15. Your versions, sizes, counts, mirror lines, and transfer rates will differ. The required evidence concerns state and relationships, not identical totals.

Reach these six goals:

  1. Establish that the configured indexes describe sl. Identify its offered version, dependency names, and the difference between this metadata and installed state. Explain why trusting its repository matters before a privileged installation.
  2. Review and decline an installation plan. Identify which requirement needs an additional package in this lab and which dependencies are already satisfied. Then perform only the reviewed installation.
  3. Prove both packages are installed. Find sl’s executable through its package file list, then independently identify the package owning that exact path. Running the animation is not required.
  4. Inspect pending installed-package upgrades and decline their plan. Explain why refreshing indexes did not apply those changes, whether a full-upgrade can remove packages, and why an Ubuntu release migration is a separate task. State why this container cannot provide service-restart evidence.
  5. Give the RPM counterparts for finding an installed file’s owning package and listing that package’s files. Identify which operations are static references here. Explain why Flatpak/Snap applications can require separate update checks.
  6. Remove only the exercise additions after reviewing both cleanup plans. Prove that the executable is absent and no installed records remain, while repository metadata can still describe sl.

Predict before goal 6: must removing installed files also erase the repository’s description of the package?

Run it, then compare with your guess

No. The metadata describes available software; the installed records and executable describe the local installation. Your final checks must establish both sides independently.

  • An exact-name search finds sl after a successful index refresh. Its metadata lists three dependency names; the plan adds only sl and libncurses6 in this baseline.
  • The declined plan changes no installed software. The accepted installation produces installed-state records for both packages.
  • The file list of sl contains /usr/games/sl, and an ownership query identifies sl as its package.
  • The upgrade review is declined. Your explanation separates metadata refresh, package upgrade, broader dependency resolution, release migration, and affected-program restarts.
  • RPM queries are references rather than Ubuntu captures. Flatpak and Snap keep their own application package state and update mechanisms.
  • Final queries find neither installed package, and a filesystem test confirms the executable is gone. The repository still describes sl. No unrelated packages were removed or upgraded.
Hint for metadata and the plan

Authenticate sudo without exposing the password. Refresh indexes, then search the exact name. apt-cache can display metadata; grep can select named fields. Read the proposed additions rather than counting every dependency as missing.

Hint for independent evidence

Use an installed-state query, a package file list, and a file-ownership query. Each answers a different question. A search match alone is not an installation receipt.

Hint for cleanup

Remove the requested package first. Inspect the automatically installed dependencies proposed for cleanup before accepting anything. Afterward, compare installed records and the actual executable path with cached metadata.

Solution

Authenticate, refresh, and identify the candidate.

Terminal window
sudo -v
sudo apt update
apt search --names-only '^sl$'
apt-cache show sl | grep -E '^(Package|Version|Depends):'

Answer sudo’s prompt with your own lab password. Nothing appears while it is typed. apt-cache reads the cached package metadata without apt’s interactive CLI warning in a pipeline. The three selected fields establish package identity, version, and dependencies, not installation.

Authenticate and inspect the candidate
learner@rootvolt:~/lab$ sudo -v[sudo] password for learner: learner@rootvolt:~/lab$ sudo apt updateGet:1 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB]
Get:3 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Packages [55.6 kB]
Get:4 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [1,557 kB]
Get:5 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Packages [2,211 kB]
Get:6 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Get:7 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [1,471 kB]
Get:8 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]
Get:9 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [19.3 MB]
Get:10 http://archive.ubuntu.com/ubuntu noble/restricted amd64 Packages [117 kB]
Get:11 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [331 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1,808 kB]
Get:13 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [2,179 kB]
Get:14 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Packages [61.7 kB]
Get:15 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1,792 kB]
Get:16 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages [2,324 kB]
Get:17 http://archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Packages [669 B]
Get:18 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages [36.0 kB]
Get:19 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 Packages [49.0 kB]
Fetched 33.9 MB in 5s (6,438 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$ 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$ apt-cache show sl | grep -E '^(Package|Version|Depends):'Package: sl
Version: 5.02-1
Depends: libc6 (>= 2.2.5), libncurses6 (>= 6), libtinfo6 (>= 6)learner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. The solution authenticates without exposing its password, refreshes indexes, and selects the candidate's identifying metadata.
Steps (14)
  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://security.ubuntu.com/ubuntu noble-security InRelease [126 kB] Get:2 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB] Get:3 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Packages [55.6 kB] Get:4 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [1,557 kB] Get:5 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Packages [2,211 kB] Get:6 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB] Get:7 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [1,471 kB] Get:8 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB] Get:9 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [19.3 MB] Get:10 http://archive.ubuntu.com/ubuntu noble/restricted amd64 Packages [117 kB] Get:11 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [331 kB] Get:12 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1,808 kB] Get:13 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [2,179 kB] Get:14 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Packages [61.7 kB] Get:15 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1,792 kB] Get:16 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages [2,324 kB] Get:17 http://archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Packages [669 B] Get:18 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages [36.0 kB] Get:19 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 Packages [49.0 kB] Fetched 33.9 MB in 5s (6,438 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.
  9. Type apt search --names-only '^sl$'
  10. Press Enter
  11. Output: Sorting... Done Full Text Search... Done sl/noble 5.02-1 amd64 Correct you if you type `sl' by mistake
  12. Type apt-cache show sl | grep -E '^(Package|Version|Depends):'
  13. Press Enter
  14. Output: Package: sl Version: 5.02-1 Depends: libc6 (>= 2.2.5), libncurses6 (>= 6), libtinfo6 (>= 6)

The dependency names are libc6, libncurses6, and libtinfo6. Repository authentication connects package data to a trusted publisher; installation scripts can run with administrative privileges. A matching name alone is not a reason to trust an added source.

Review, install, and establish file evidence.

Terminal window
sudo apt install --assume-no sl

Check that only the two exercise packages are added, with no upgrades or removals. The plan answers N and aborts intentionally. An ordinary install would let you answer its confirmation yourself. The recording accepts the already-reviewed small plan automatically:

Terminal window
sudo apt install --yes -o Dpkg::Progress-Fancy=0 sl
dpkg-query -W -f='${Package} ${Status}\n' sl libncurses6
dpkg -L sl | grep '/usr/games/'
dpkg -S /usr/games/sl

The display option disables progress drawing, as in B12.2. --yes accepts confirmation and belongs only to this checked lab procedure. Both packages reach install ok installed. The filtered file list finds the executable, and the separate ownership query links that path to sl.

Review the plan and establish installed-file evidence
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$ 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 (93.0 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 -L sl | grep '/usr/games/'/usr/games/sllearner@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. The solution declines the first plan, installs the reviewed pair, and verifies installed records, the executable path, and its package owner.
Steps (15)
  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.
  4. Type sudo apt install --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 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 (93.0 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) ...
  7. Type dpkg-query -W -f='${Package} ${Status}\n' sl libncurses6
  8. Press Enter
  9. Output: libncurses6 install ok installed sl install ok installed
  10. Type dpkg -L sl | grep '/usr/games/'
  11. Press Enter
  12. Output: /usr/games/sl
  13. Type dpkg -S /usr/games/sl
  14. Press Enter
  15. Output: sl: /usr/games/sl

Review updates without expanding the exercise.

Terminal window
apt list --upgradable
sudo apt upgrade --assume-no
Review and decline unrelated upgrades
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. The solution inspects pending installed-package upgrades and declines them without changing those packages.
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.

Index refresh changed the local description of available software. Upgrade would replace installed packages; full-upgrade could also remove packages to resolve dependencies. Neither command alone is Ubuntu’s supported release-migration procedure. Updated files can require application or service restarts, and an installed kernel usually requires a reboot to run. This container has no running systemd, so it cannot supply real service-restart evidence.

Translate the inspection task.

On an RPM-based system, rpm -qf /path/to/file identifies an installed file’s package, then rpm -ql PACKAGE lists the selected package’s paths. Substitute actual names from that machine. These are static documentation references here; the real Ubuntu commands above use dpkg. DNF handles repository transactions for the RPM family. Flatpak/Snap manage separate application packages, so native-system upgrade evidence alone does not establish their application update state.

Reset and prove the boundary.

Review and remove sl, then review unused dependencies:

Terminal window
sudo apt remove --assume-no sl
sudo apt remove --yes -o Dpkg::Progress-Fancy=0 sl
sudo apt autoremove --assume-no
Terminal window
sudo apt autoremove --yes -o Dpkg::Progress-Fancy=0
dpkg-query -W -f='${Package}: ${Status}\n' sl libncurses6
test ! -e /usr/games/sl && printf 'Temporary executable removed\n'
apt-cache show sl | grep -E '^(Package|Depends):'

The query reports no matching installed records. The test checks absence of the executable and prints confirmation only if it is absent. Cached metadata still identifies sl and its dependencies. These independent checks establish the requested reset without confusing absence from the filesystem with absence from a repository.

Remove only the exercise packages and verify absence
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$ 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$ dpkg-query -W -f='${Package}: ${Status}\n' sl libncurses6dpkg-query: no packages found matching sl
dpkg-query: no packages found matching libncurses6learner@rootvolt:~/lab$ test ! -e /usr/games/sl && printf 'Temporary executable removed\n'Temporary executable removedlearner@rootvolt:~/lab$ apt-cache show sl | grep -E '^(Package|Depends):'Package: sl
Depends: libc6 (>= 2.2.5), libncurses6 (>= 6), libtinfo6 (>= 6)learner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. The solution removes only sl and its unused library, verifies the executable and installed records are gone, and confirms metadata still exists.
Steps (21)
  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) ...
  7. Type sudo apt autoremove --assume-no
  8. Press Enter
  9. 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.
  10. Type sudo apt autoremove --yes -o Dpkg::Progress-Fancy=0
  11. Press Enter
  12. 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) ...
  13. Type dpkg-query -W -f='${Package}: ${Status}\n' sl libncurses6
  14. Press Enter
  15. Output: dpkg-query: no packages found matching sl dpkg-query: no packages found matching libncurses6
  16. Type test ! -e /usr/games/sl && printf 'Temporary executable removed\n'
  17. Press Enter
  18. Output: Temporary executable removed
  19. Type apt-cache show sl | grep -E '^(Package|Depends):'
  20. Press Enter
  21. Output: Package: sl Depends: libc6 (>= 2.2.5), libncurses6 (>= 6), libtinfo6 (>= 6)

Answer before opening each explanation.

1. Why can a search result exist when the executable is absent?

Answer

Search uses repository metadata. It describes offered software without installing its program files. Installed package records and the filesystem provide separate evidence.

2. Why does a package with three dependencies add only one dependency package here?

Answer

The baseline already satisfies the other requirements. APT selects changes from dependency metadata and existing package state, rather than reinstalling every named dependency.

3. What did the upgrade review change, and how does full-upgrade differ?

Answer

The declined plan changes no installed packages. apt upgrade can add requirements but does not remove installed packages; full-upgrade can remove packages to resolve dependency changes. Neither is automatically a release migration.

4. Why might installed-state evidence be insufficient after updating a service?

Answer

It establishes package state on disk, not which code the running service uses or whether it is healthy. Read restart requirements and verify the affected service after any needed restart. The capture container cannot demonstrate that VM behavior.

5. Which part of this practice can be transferred to an RPM system without assuming identical names?

Answer

The inspection tasks transfer: identify a real file’s package and list its paths. Use RPM’s own queries and the target machine’s paths and package names. Flatpak/Snap remain separate application package systems rather than RPM or APT aliases.

6. Why review autoremove after the requested package has gone?

Answer

Automatic dependencies can remain installed but become unused. The plan may also include unrelated unused packages on another machine. Review the actual removal set before accepting cleanup.

Goal 6 and the solution’s final replay perform the recorded reset. They remove sl and only its unused lab dependency, then verify installed-record and executable absence. No exercise files were created. Refreshed metadata remains intentionally. Do not purge caches or remove other packages to imitate an empty image; rerun the initial-state check before repeating the practice.

  • Collect separate evidence for available metadata, installed state, package paths, and file ownership.
  • Review every installation, upgrade, and cleanup plan against the intended scope.
  • Translate tasks between package families without assuming names or options transfer.
  • Verify the reset independently while preserving unrelated installed software.

Next, Processes and identifiers connects running instances to their parent shell.