Continuing package history: utilities after initial preparation

Adding utilities after two original APT records through the administrator. Plans bind the preceding record, verify it under locks and refuse repeated or pending operations.

Three consecutive package-history links with integrity markers.
Three consecutive package-history links with integrity markers.

After initial preparation and reboot, the server already has package history. Our run contains two records: an APT index refresh and approved kernel installation. We now add base utilities through the administrator while retaining both records and their original approvals.

Installation starts from a specific preceding record

Continuation requires the SHA256 and exact size of the last retained record. We take both values from verified history. The new plan binds both fields. Selecting another size or record invalidates that approval.

The server must also compare the current record with the expected one under the same APT locks that protect the package operation. It checks after acquiring those locks and again before creating a pending record. A separate check before command execution would leave a gap for history to change.

Approving the index refresh separately

On a fresh isolated Debian 13 VM, we completed initial EFI and APT steps, one controlled reboot and independent serial-console evidence for the new boot. Original access setup created the administrator and closed root SSH. Subsequent package commands used the selected administrator key and password-required sudo.

We first create a separate private index-refresh plan. Variables below represent explicitly selected private files and retained fingerprints. Key and password values are not command arguments.

deploy-cli host packages continue refresh-plan \
  --env-file "$ADMIN_ENV" --request-file "$CURRENT_REQUEST" \
  --predecessor-sha256 "$INITIAL_HEAD_SHA256" \
  --predecessor-size "$INITIAL_HEAD_SIZE" \
  --plan-file "$REFRESH_PLAN" --approve-local-write

After reviewing the plan, we approve that specific index refresh:

deploy-cli host packages continue refresh \
  --env-file "$ADMIN_ENV" --request-file "$CURRENT_REQUEST" \
  --predecessor-sha256 "$INITIAL_HEAD_SHA256" \
  --predecessor-size "$INITIAL_HEAD_SIZE" \
  --plan-file "$REFRESH_PLAN" --plan-sha256 "$REFRESH_SHA256" \
  --approve-privileges

This operation adds a third record to the existing chain. It installs no packages. The original two records and history objects remain retained. The next plan selects the newly verified end of the chain.

Installing explicitly listed utilities

The install plan names specific packages. APT can add required dependencies; this command requests no system-wide upgrade. We review the entire approved archive closure before installation, rather than only the eleven command-line names.

deploy-cli host packages continue plan \
  --env-file "$ADMIN_ENV" --request-file "$CURRENT_REQUEST" \
  --predecessor-sha256 "$REFRESH_HEAD_SHA256" \
  --predecessor-size "$REFRESH_HEAD_SIZE" \
  --plan-file "$UTILITY_PLAN" --approve-local-write \
  --package acl --package ca-certificates --package curl \
  --package gnupg --package gpgv --package nftables \
  --package openssl --package python3 --package python3-apt \
  --package sudo --package wireguard-tools

For this continuation, every approved change was a new installation; no archive replaced an installed version. Index refresh and installation have separate plans and approvals. We then execute the installation:

deploy-cli host packages continue apply \
  --env-file "$ADMIN_ENV" --request-file "$CURRENT_REQUEST" \
  --predecessor-sha256 "$REFRESH_HEAD_SHA256" \
  --predecessor-size "$REFRESH_HEAD_SIZE" \
  --plan-file "$UTILITY_PLAN" --plan-sha256 "$UTILITY_SHA256" \
  --approve-privileges

Selected fields from the actual successful install response:

{
  "status": "passed",
  "write_performed": true,
  "access_verified": true
}

After installation, the CLI opens a fresh SSH execution for verification. It must see the exact successor, its approved predecessor and the same plan. We also checked installed versions with the standard command:

dpkg-query -W -f '${Package} ${Version}\n' nftables wireguard-tools
nftables 1.1.3-1
wireguard-tools 1.0.20210914-3

A repeated write and a pending operation

After the successful refresh, we repeated the call with the same approval and original predecessor. The server already had another history head, so the command refused before writing. Selected fields from the actual response:

{
  "status": "failed",
  "write_performed": false,
  "error": "package controller refused operation: history"
}

We tested pending state with a separate controlled file on the fixture. The command refused while preserving that file and the selected records. The fixture removed only its own file separately. An unknown installation outcome does not authorize an automatic retry.

The fixture chain now contains four package records: original indexes, kernel, new indexes and utilities. An exact predecessor check protects continuation. Accepting the complete service chain also requires explicit proof of the reboot transition: the running kernel changed across that boundary. That connection still needs integration into the wizard.

The frame below is a genuine terminal displaying a labeled summary of saved results. It is not raw command output; capture repeated no installation or reboot. This run changed neither the training VPS nor production.

Continuing package history while retaining original records
Continuing package history while retaining original records
  1. Platform Engineering Accepting the prepared image after reboot: EFI, directories and a new reference
  2. Platform Engineering Packages after reboot: checking versions and original history
  3. Platform Engineering Connecting the prepared image to the wizard: credentials and planning without server writes
  4. Platform Engineering Reading original preparation through the administrator after closing root SSH
  5. Platform Engineering How the CLI verifies a completed package operation

A project by the author · Weather Solution200

After reading, a look outside.

Temperature, rain and wind in your city. Check the forecast and plan the hours ahead.

Check the forecast
Next article