Installing a small program is easy to request. Deciding whether this exercise may later remove it requires evidence from before the installation. A package already on the guest belongs to its existing setup, even when its name appears in this course.
You will use tree to inspect three supplied files. On a clean, owned guest
where tree is genuinely absent, you will review, install, use and remove only
that package. If tree is already installed, you will inspect, use and retain
it. That useful observation branch does not demonstrate installation and
removal; complete those actions on a separate clean owned course baseline.
1. Know which changes belong to this task
Complete Inspect package and repository state
first. Use the ordinary nonzero-UID account in the declared Ubuntu 24.04
amd64 guest, with Bash and authorized guest sudo. These are guest
operations. Do not run this procedure on the host or another shared machine.
| Action | Meaning and permitted effect |
|---|---|
apt update | Refreshes local repository indexes. It contacts configured repositories; it does not mean “upgrade installed packages.” |
apt-get --simulate install tree | Describes a proposed operation without applying that package transaction. The proposal is evidence to review, not a reservation or guarantee. |
apt install tree | May download, unpack and configure the requested package and whatever else its actual plan requires. This lesson accepts a plan changing only tree. |
apt remove tree | Removes an installed package, but can retain configuration. It is not a purge or a complete machine rollback. |
For this task, reversible means restoring tree's original installed or not-installed presence while preserving preexisting software. Refreshed indexes, downloaded cache data, logs, package-trigger effects and possible residual configuration can remain. Do not claim that every guest byte is restored. Do not use upgrade, purge, autoremove, apt-mark or a base-package removal to make the exercise look tidy.
Before beginning, read through the branch, independent work and cleanup. Run one line at a time, inspect its result and stop on an unexpected error. The note you create records actual observations; supplied examples are not values to paste over a failed or missing observation.
2. Confirm the guest, tools and unchanged query scope
Use the command-origin model from earlier lessons. First inspect:
type cd pwd printf set declare type id ps mkdir ls cat wc nano rm rmdir sudo apt apt-get dpkg-query apt-cache
Require cd, pwd, printf, set, declare and type to be Bash builtins,
and the other names to resolve to the expected guest utilities. For ls,
the already-taught color-only alias is acceptable only after all matches
are understood:
type -a ls
type -P ls
Stop for an unexpected alias, function or executable origin. Preserve the session configuration. Then check the actual identity and shell:
id -u
id -un
ps -p $ -o comm=
set -o
Require your recorded nonzero UID and Bash. Require errexit off so expected
missing-name results can be interpreted; do not change a different setting
here. Reuse the previous lesson's named, read-only scope inspection:
declare -p DPKG_ROOT
declare -p DPKG_ADMINDIR
declare -p APT_CONFIG
Require every name undeclared, including no empty declaration. Dpkg root or database overrides and APT configuration selection would change the scope. This conservative course condition is stricter than inheritance: an unexported local variable is not automatically inherited. Preserve any existing declaration and reconcile the baseline; do not unset it.
Use the checked course guest with understood official Ubuntu package sources and ordinary package-manager configuration. Unexplained custom repositories, automatic actions or local package hooks are outside this exercise. Do not rewrite their configuration to continue; return to a known clean owned baseline. The per-command prompt options below address automatic answers, not every possible customization.
3. Build the small owned fixture and evidence note
The exercise owns only
~/linux-practice/practice-a-reversible-package-transaction/ and, conditionally,
the new tree installation established by this attempt's evidence. Inspect
the known parents and prospective task name without trailing slashes:
ls -ld ~
ls -ld ~/linux-practice
ls -ld ~/linux-practice/practice-a-reversible-package-transaction
Require ordinary parent directories owned by your recorded account and the task name absent. An existing task needs the resume section, not a fresh overwrite. After acceptance:
mkdir ~/linux-practice/practice-a-reversible-package-transaction
ls -ld ~/linux-practice/practice-a-reversible-package-transaction
Accept the newly created ordinary owned directory, then enter separately:
cd ~/linux-practice/practice-a-reversible-package-transaction
pwd
ls -a
Require the exact recorded task path and only dot entries before creating the fixture directories:
mkdir fixture
mkdir fixture/notes
ls -ld -- fixture fixture/notes
ls -a -- fixture
ls -a -- fixture/notes
Require ordinary owned directories; fixture contains only notes and dot
entries, and notes is empty. The following exact file names must be absent.
The taught > creates each fresh output; %s\n writes one complete line.
The quoted spaced path is one operand, and the leading dot makes the third
name hidden in an ordinary listing.
printf '%s\n' 'Read this small tree.' > fixture/plan.txt
printf '%s\n' 'Keep the original package state.' > 'fixture/notes/day one.txt'
printf '%s\n' 'This hidden note belongs to the exercise.' > fixture/.course-note.txt
printf '%s\n' 'Package transaction: tree' 'Initial state below belongs to this attempt; never replace it with a later state.' > evidence.txt
Require every write to succeed. Inspect before continuing:
ls -ld -- evidence.txt fixture/plan.txt 'fixture/notes/day one.txt' fixture/.course-note.txt
cat fixture/plan.txt 'fixture/notes/day one.txt' fixture/.course-note.txt
wc -l -- fixture/plan.txt 'fixture/notes/day one.txt' fixture/.course-note.txt
cat evidence.txt
Require owned ordinary single-link files, exactly the three supplied lines in operand order, one newline per file and total three. Counts supplement the complete text comparison. The two evidence-header lines must be intact. Keep this note outside fixture so it does not change tree's expected paths.
For every evidence section below, first recheck that evidence.txt is still
the same owned ordinary single-link file. Require its header/append writes
and redirections to succeed. >> evidence.txt 2>&1 opens stdout in append
mode, then points stderr at that same destination. It does not promise an
arrival order between the streams. The immediate printf records the preceding command's $?. Do not
run an intervening command or use a later status to reconstruct lost evidence.
4. Record the initial state and choose a branch
Use the exact taught dpkg format. Single quotes leave ${...} for dpkg's
formatter; the brackets preserve visibility of all three abbreviation
characters, including a final blank.
printf '%s\n' '--- INITIAL package database ---' >> evidence.txt
dpkg-query --no-pager --show --showformat='package=${binary:Package}\nabbrev=[${db:Status-Abbrev}]\nstatus=${Status}\nversion=${Version}\n' tree >> evidence.txt 2>&1
printf 'initial query exit: %s\n' "$?" >> evidence.txt
cat evidence.txt
Then record lookup and cached policy as separate facts:
printf '%s\n' '--- INITIAL command lookup ---' >> evidence.txt
type -a tree >> evidence.txt 2>&1
printf 'initial lookup exit: %s\n' "$?" >> evidence.txt
printf '%s\n' '--- INITIAL cached policy ---' >> evidence.txt
apt-cache policy tree >> evidence.txt 2>&1
printf 'initial policy exit: %s\n' "$?" >> evidence.txt
cat evidence.txt
| Actual initial evidence | Branch |
|---|---|
Fully installed, such as [ii ] or held-installed [hi ], with its actual full status and version | Present: preserve it. Skip the entire update/simulation/install section. Verify the executable in section 6, use it and later retain it. |
The single-name query reports an explicit no-match with exit 1; policy says Installed (none); no unexplained command/path exists | Potential clean absent: verify the owned baseline and source/transaction conditions in section 5. |
Residual [rc ], unpacked state, error flag, unfamiliar combination, contradictory evidence or fatal query error | Stop and reconcile: this is not a clean absent transaction starting point. |
A query exit 0 means the query succeeded, not necessarily that tree is
installed. Exit 1 supports the no-record interpretation only with the
explicit single-name no-match diagnostic; exit 2 is a fatal query error.
A candidate alone does not prove installation or live availability. A
candidate backed only by /var/lib/dpkg/status does not establish
availability from an Ubuntu repository.
For the potential absent branch, inspect the expected executable path:
ls -ld /usr/bin/tree
Require it absent. An unexpected existing file/link or command match needs reconciliation before any installation, not replacement. Do not invent an absent baseline by uninstalling preexisting tree. If the current guest has tree, finish its use/retain branch and use a separately prepared clean owned course VM/checkpoint for the required install/remove practice. Without one, leave that transaction practice pending.
5. Clean absent branch: refresh, simulate, decide, install
This section is only for the consistently clean absent state just recorded.
On the present branch, skip to section 6 without running update, simulation,
install or remove. Keep the learner account normal; sudo authorizes just
the named guest package command. Enter your own guest password privately
if requested; password entry may show no characters. Authorization failure
is a reason to stop, not to open a root shell.
Understand the command options and decision point
apt is the interactive package interface used for the real operations.
apt-get --simulate supplies a proposed plan without applying it. The
following options are command-scoped APT configuration, not Bash assignment
or persistent configuration edits:
Each repeated -o supplies one Setting=Value item. The :: characters
separate parts of APT's configuration key; false is a Boolean value.
| Option | Purpose |
|---|---|
-o APT::Get::Assume-Yes=false | Disable configured automatic affirmative answers for this invocation. |
-o APT::Get::Assume-No=false | Disable configured automatic negative answers for this invocation. |
-q=0 | Select normal verbosity instead of inheriting a quiet level that may change interaction. |
--simulate | Describe the proposed package actions without applying the package transaction. |
These options do not guarantee a later confirmation prompt. A package operation can begin without asking again. Your final decision is therefore before invoking the real install/remove command, after the fresh checks and simulation. If a prompt does appear, inspect the actual plan and respond only using an understood documented response convention; never guess an unfamiliar affirmative response. Declining means stop that transition and inspect actual state, not pretend it completed.
Simulation disables package-manager locking. Using sudo avoids missing root-readable configuration in that observation, but does not reserve the plan. Package state, repository information or another operation can change between simulation and action. Work on the quiet owned guest, recheck immediately, and stop for uncertainty. This is not an atomic tree-only transaction guard. If an unexpected wider action has already begun, preserve its evidence and reconcile it; do not report a successful bounded exercise.
Refresh only the understood official sources
Read the declared source file before contacting repositories:
cat /etc/apt/sources.list.d/ubuntu.sources
Require the understood official Ubuntu configuration for this guest, including the required Universe component, and no unexplained added source configuration. Do not add a repository or key, bypass a signature failure or rewrite sources to obtain tree. Leave actual apt output and input visible:
sudo apt -o APT::Get::Assume-Yes=false -o APT::Get::Assume-No=false -q=0 update
printf 'index refresh exit: %s\n' "$?" >> evidence.txt
Require successful refresh and inspect all output for failed fetches, signature/source errors or stale-index warnings. An exit number alone is not a fresh-source check. Update's indexes, cache and logs can remain later.
Use the taught editor to record the actual observations without hiding an interactive command in a redirection. Before opening nano, require the status append to have succeeded. In nano, preserve existing lines, move to the end, append a labelled description of the refresh result and any warnings, then use Ctrl+O, Enter to save the same filename and Ctrl+X to exit. Do not insert a successful description if it failed.
nano evidence.txt
cat evidence.txt
Query refreshed policy separately:
printf '%s\n' '--- Refreshed policy before install ---' >> evidence.txt
apt-cache policy tree >> evidence.txt 2>&1
printf 'refreshed policy exit: %s\n' "$?" >> evidence.txt
cat evidence.txt
Require no installed version, a candidate and a corresponding expected official Ubuntu/Universe repository row. Record the actual candidate version and origin. Policy still reads local metadata; download or locking can fail later. No candidate, unknown origin or a status-only candidate is not installation readiness.
Review the proposed install and recheck the baseline
Keep the simulation visible, then record its immediate status:
sudo apt-get -o APT::Get::Assume-Yes=false -o APT::Get::Assume-No=false -q=0 --simulate install tree
printf 'install simulation exit: %s\n' "$?" >> evidence.txt
Require a successful plan that newly installs and configures tree only,
at the expected candidate version. A simulation may label those actions
Inst and Conf; both may refer to the same one package. No other new
package, upgrade, removal or unrelated configuration action is accepted.
A count of packages “not upgraded,” or a suggestion about autoremove, is
not itself a planned action; read the actual action list and do not run
the suggestion. Record the actual plan/version with nano and inspect the
saved note as above.
Immediately before choosing the real action, repeat the named database query with a new label; never replace the INITIAL section:
printf '%s\n' '--- Recheck immediately before install ---' >> evidence.txt
dpkg-query --no-pager --show --showformat='package=${binary:Package}\nabbrev=[${db:Status-Abbrev}]\nstatus=${Status}\nversion=${Version}\n' tree >> evidence.txt 2>&1
printf 'pre-install query exit: %s\n' "$?" >> evidence.txt
cat evidence.txt
Require the same explicit clean absence, unchanged source/candidate and no other package operation in progress. If time, state or evidence changed, repeat the relevant observations and simulation before deciding. Only after accepting that bounded plan and the remaining race limitation, run:
sudo apt -o APT::Get::Assume-Yes=false -o APT::Get::Assume-No=false -q=0 install tree
printf 'install command exit: %s\n' "$?" >> evidence.txt
Keep the terminal interaction visible. If asked, inspect the real proposal again and decline any extra action. If no prompt appears, the command may already be acting; a missing prompt is not proof of a failure or a safety check. After the immediate status is saved, append the actual displayed actions, selected version, response/no-prompt observation and outcome with nano. A declined, interrupted or failed operation does not establish a successful course installation.
Record the actual resulting database state:
printf '%s\n' '--- Result after course install ---' >> evidence.txt
dpkg-query --no-pager --show --showformat='package=${binary:Package}\nabbrev=[${db:Status-Abbrev}]\nstatus=${Status}\nversion=${Version}\n' tree >> evidence.txt 2>&1
printf 'post-install query exit: %s\n' "$?" >> evidence.txt
cat evidence.txt
Require [ii ], full status install ok installed, and the recorded
expected version, together with successful bounded transaction evidence.
That chain establishes this attempt's removal eligibility. An installed
row without the initial absence and actual install evidence does not.
6. Both valid branches: verify the program and inspect the fixture
Before executing tree, separate package state, shell lookup and pathname
ownership. The new dpkg-query --search operation asks which package database
entry owns the supplied exact pathname; it does not run the file or prove
its contents. Inspect:
type -a tree
type -P tree
dpkg-query --search /usr/bin/tree
ls -ld /usr/bin/tree
Require the expected distribution executable /usr/bin/tree, the tree
package's ownership record, and no unexplained alias/function or custom
origin. Stop for disagreement rather than executing a same-named unknown
program. The package must be fully installed; a preexisting held installation
stays held. No reinstall or upgrade is needed to “normalize” it.
For this utility, -a includes hidden names other than dot/dotdot, -n
disables color, and -- ends option parsing before the explicit directory
operand. We do not combine -n with the conflicting color-forcing -C.
The absolute executable path bypasses shell aliases for this invocation.
Predict which file an ordinary non-hidden listing could miss. Recheck the recorded task location and known fixture identities/inventory before:
printf '%s\n' '--- Tree of the owned fixture ---' >> evidence.txt
/usr/bin/tree -a -n -- fixture >> evidence.txt 2>&1
printf 'tree exit: %s\n' "$?" >> evidence.txt
cat evidence.txt
Require successful output identifying exactly these relationships:
| Kind | Path beneath the task root |
|---|---|
| Starting directory | fixture/ |
| Child directory | fixture/notes/ |
| Regular file | fixture/plan.txt |
| Regular file with a space | fixture/notes/day one.txt |
| Hidden regular file | fixture/.course-note.txt |
Terminal drawing characters and ordering can vary. Match names and nesting, not a memorized graphic. Tree lists names; it does not replace checking the three original file contents. Read them and repeat the taught newline check from section 3. They must remain unchanged.
7. Diagnose a difference before trying another mutation
| Evidence | Meaning and next safe step |
|---|---|
| A package-manager lock is unavailable | Another legitimate operation may be active. Let it finish, then requery and re-simulate; do not delete locks or kill its process. |
| Fetch/signature/source warning, or no expected official candidate | Source readiness failed. Preserve the output and reconcile the known guest configuration; do not add unknown repositories or bypass verification. |
| Simulation proposes an extra install, upgrade or removal | The plan exceeds this task. Reject it before the real command. |
| Real operation failed, was interrupted or had broader effects | Preserve actual output/status and current state. Do not run generic repair, force, purge or guessed cleanup. Reconcile the attempt before continuing. |
| Tree is installed but its earlier provenance is missing | Preserve the installation. Present state alone gives no permission to remove it. |
| A filename is missing from tree's output | Recheck the exact fixture path, hidden-name option, identities and inventory. A successful exit does not prove your expected input existed. |
Independent task: reject a wider plan and repeat the safe observation
Keep tree and the fixture in their present state until after this task and the explained answer. The following is supplied teaching data, not a transcript from your guest and not an instruction to install these items:
| Proposed change | Supplied wider plan |
|---|---|
| New package | tree |
| Additional new package | an unrelated helper |
| Upgrade | an existing base package |
| Remove | none |
Before opening hints or the answer:
- Decide whether that plan meets the lesson's boundary. Name the specific disqualifying changes and the last safe decision point if no real prompt is guaranteed.
- On your actual now-installed branch, append a labelled read-only rerun section: query tree's actual state/version again and run the verified tree executable on the same fixture. Record each immediate status. Do not update, reinstall, upgrade or remove a package in this task.
- Compare your initial and current records. Explain who owns the later removal decision if tree was initially present, if this attempt proved absence then installed it, or if the earlier evidence was lost.
- Explain what evidence is still missing when only the preexisting use/retain branch was possible. Do not call a simulation an installation.
Success: reject all extra package changes, preserve the original record, produce a new actual query and fixture listing without another transaction, and justify cleanup eligibility from provenance. If the current state or version unexpectedly changed, preserving it and recording the mismatch is the correct stop, not a forced successful rerun.
Graduated hints
- Count the packages whose state would change, including upgrades; the requested command's last word is not the whole transaction plan.
- Reuse the exact named query and tree observation from the guided work. A new label distinguishes a new observation from INITIAL evidence.
- Present-now and installed-by-this-attempt answer different questions. Removal needs the complete absent-before, successful-install and unchanged-current-state chain.
Answer and Reasoning
Reject the supplied wider plan. Both the unrelated new helper and the base-package upgrade exceed the tree-only exercise. Make that decision before invoking a real operation, because a later confirmation is not guaranteed. If a prompt is shown, it is another chance to inspect and decline, not a substitute for earlier review. Do not accept extra changes just because the simulation itself made no changes.
After rechecking the actual installed branch, note identity and task path, a complete read-only rerun is:
printf '%s\n' '--- Independent read-only rerun: package ---' >> evidence.txt
dpkg-query --no-pager --show --showformat='package=${binary:Package}\nabbrev=[${db:Status-Abbrev}]\nstatus=${Status}\nversion=${Version}\n' tree >> evidence.txt 2>&1
printf 'rerun query exit: %s\n' "$?" >> evidence.txt
cat evidence.txt
Require the same recognized fully installed state/version before continuing. A new hold, error, different version or contradiction stops this rerun; preserve that observation rather than executing the next block. Once accepted:
printf '%s\n' '--- Independent read-only rerun: fixture ---' >> evidence.txt
/usr/bin/tree -a -n -- fixture >> evidence.txt 2>&1
printf 'rerun tree exit: %s\n' "$?" >> evidence.txt
cat evidence.txt
Read every append result and the full saved sections. Require the same recognized installed version/state and the same three files in their recorded locations, with one child directory. Your earlier source content/newline checks remain necessary; this listing alone is not content evidence.
Initially present tree remains installed, including a preexisting hold. Neither its course use nor this rerun authorizes removal. If the initial absence, bounded successful installation and unchanged current state are all documented, the later removal section belongs to this attempt. If that chain is missing or contradicted, preserve tree and reconcile the evidence.
A use/retain run demonstrates lookup, package interpretation and use of the tool. The required installation/removal evidence is still missing. Perform that part on a separate clean owned baseline with its own initial record, or leave it pending. Do not invent a successful transaction or remove the preexisting package to obtain one.
8. Restore package presence before cleaning up files
Present-before branch: retain it
For a preexisting installation, do not execute any removal command below. Your independent query must still show its recorded installed state/version and any existing hold. Retain it. If something changed unexpectedly, keep the evidence and reconcile the difference. Then use the file cleanup only after the current observation is settled.
Proven course installation: recheck, simulate and remove only tree
Before removal, re-read the initial absence and successful course-install sections. Require no unexplained intervening package changes. Record fresh state and policy separately:
printf '%s\n' '--- Recheck before course removal ---' >> evidence.txt
dpkg-query --no-pager --show --showformat='package=${binary:Package}\nabbrev=[${db:Status-Abbrev}]\nstatus=${Status}\nversion=${Version}\n' tree >> evidence.txt 2>&1
printf 'pre-remove query exit: %s\n' "$?" >> evidence.txt
apt-cache policy tree >> evidence.txt 2>&1
printf 'pre-remove policy exit: %s\n' "$?" >> evidence.txt
cat evidence.txt
Require the exact version installed by this attempt, [ii ] and its full
installed status, with understood unchanged origin. A new hold, different
version, residual/error state or lost provenance blocks ordinary cleanup.
Do not infer ownership from the mere presence of tree.
Review the removal proposal before any real removal:
sudo apt-get -o APT::Get::Assume-Yes=false -o APT::Get::Assume-No=false -q=0 --simulate remove tree
printf 'remove simulation exit: %s\n' "$?" >> evidence.txt
Require successful simulation proposing to remove only tree, with no additional removal, installation or upgrade. Record the actual proposal with nano. Ignore an autoremove suggestion as an instruction; do not run it. Recheck the current state if there was any delay or intervening operation. Only after choosing this reviewed action under the unchanged conditions:
sudo apt -o APT::Get::Assume-Yes=false -o APT::Get::Assume-No=false -q=0 remove tree
printf 'remove command exit: %s\n' "$?" >> evidence.txt
Leave output/input visible. If a prompt appears, inspect the real plan and decline any additional action. Save the actual response/no-prompt behavior, actions and result with nano after the immediate status. A refusal or error does not mean removal succeeded; preserve evidence and stop that transition.
Observe the final state rather than claiming it from the exit alone:
printf '%s\n' '--- FINAL package presence ---' >> evidence.txt
dpkg-query --no-pager --show --showformat='package=${binary:Package}\nabbrev=[${db:Status-Abbrev}]\nstatus=${Status}\nversion=${Version}\n' tree >> evidence.txt 2>&1
printf 'final query exit: %s\n' "$?" >> evidence.txt
type -a tree >> evidence.txt 2>&1
printf 'final lookup exit: %s\n' "$?" >> evidence.txt
ls -ld /usr/bin/tree >> evidence.txt 2>&1
printf 'final executable-path inspection exit: %s\n' "$?" >> evidence.txt
cat evidence.txt
Require actual no-longer-installed package state, absent expected executable and no unexplained command match. A clean no-record result and a residual configuration record are different: record whichever is observed. A residual record after remove does not establish a pristine no-record state, but the package can be no longer installed. Do not purge to erase that distinction. Other incomplete/error states require reconciliation, not a success claim.
The successful bounded path now has actual absent-before, installed-and-used, and not-installed-after evidence. Index/cache/log and possible configuration effects remain as explained. Preserve or retain a copy of the evidence if you need it as your personal learning record before choosing local cleanup.
9. Named file cleanup and interruption recovery
Only after independent work and a settled package branch, recheck the known parents and task entry:
ls -ld ~/linux-practice
ls -ld ~/linux-practice/practice-a-reversible-package-transaction
Require the recorded ordinary owned entries, then enter and verify:
cd ~/linux-practice/practice-a-reversible-package-transaction
pwd
Require the exact recorded task path before inspecting anything for removal:
ls -ld -- fixture fixture/notes
ls -a
ls -a -- fixture
ls -a -- fixture/notes
ls -ld -- evidence.txt fixture/plan.txt 'fixture/notes/day one.txt' fixture/.course-note.txt
cat fixture/plan.txt 'fixture/notes/day one.txt' fixture/.course-note.txt
cat evidence.txt
Require only the named ordinary owned directories/files, single-link files,
unchanged supplied contents and the reconciled evidence. Preserve links,
unknown entries or unexpected ownership. Establish the actual documented
interactive response convention first; shown y/n responses assume English
and must not be guessed for an unfamiliar prompt.
Only after those checks and choosing to discard the settled local evidence:
rm -i -- fixture/plan.txt 'fixture/notes/day one.txt' fixture/.course-note.txt evidence.txt
Inspect each exact target before approving. One negative response skips only that target; it does not cancel later prompts. To stop, decline every remaining prompt and retain the files. Never remove evidence while package ownership or an interrupted transaction remains unresolved.
After accepted named removals, inspect the inventories again:
ls -a -- fixture/notes
ls -a -- fixture
ls -a
Require notes empty, fixture containing only that empty notes directory, and the task root containing only fixture. Recheck their ordinary identities before removing the empty directories in order:
ls -ld -- fixture/notes fixture
After accepting those entries:
rmdir -- fixture/notes
rmdir -- fixture
ls -a
Require the task root empty. Return and verify separately:
cd ~/linux-practice
pwd
Require the recorded shared-root path, then inspect the task entry:
ls -ld -- practice-a-reversible-package-transaction
Only after accepting that known ordinary empty directory:
rmdir -- practice-a-reversible-package-transaction
Retain the shared practice root and every preexisting package/configuration. No wildcard, recursive removal, root cleanup or package sweep is needed.
On interruption, first restore the same known guest, ordinary identity and query scope; inspect the task directory and complete evidence before doing anything else. Append a newly labelled observation, not a replacement INITIAL section. If a package operation may still be active, let it settle and inspect the actual outcome before proposing another one. Do not blindly replay install/remove, manufacture an earlier status or run a generic repair.
A documented course installation may be resumed only when its current version/state and ownership chain still match. A fresh attempt finding tree installed must preserve it. Missing evidence, changed state or partial transactions stay pending until reconciled. Use the previously taught clean owned VM recovery route only with its explicit data-loss/identity checks; it is not an excuse to erase unrelated guest work or to claim this transaction was completed.
Sources and other study views
- S06 — Canonical package management and official source configuration
- S11 — Ubuntu Noble tree package
- S18 — Bash 5.2: lookup, quoting, redirection and immediate status
- S19 — GNU Coreutils: owned fixtures, contents and cleanup
- S28 — Ubuntu Noble apt
- S33 — Ubuntu Noble nano
- S35 — Ubuntu Noble apt-get
- S36 — Ubuntu Noble dpkg-query state and pathname ownership queries
- S46 — Ubuntu Noble sudo
- S51 — APT 2.6.1 companion: simulation and command configuration
- S52 — APT 2.6.1 companion: interactive package operations
- S57 — Sudo 1.9 companion
- S64 — Apt-cache policy and cached metadata
- S67 — GNU nano 7.2 editor controls
- S76 — Ubuntu Noble tree options
- S77 — APT implementation: confirmation is conditional
The target families are Noble APT 2.8, dpkg 1.22, tree 2.1.1, nano 7.2, Bash 5.2 and Coreutils 9.4. The APT 2.6.1 companions support the bounded interfaces; the newer APT 3.3.3 implementation supports the conservative no-guaranteed-prompt rule, not a claimed exact Noble transcript. The GNU Coreutils manual is newer than the selected 9.4 family. Actual package versions, plans, prompts and results come from your observations.
Revision reconstructs the branch and provenance decisions. Quick Reference retrieves the bounded command forms and gates.