Browse documentation

Linux maintenance reference

Status: PatchCairn's conversation workflow starts at scripts/patchcairn_workflow.py. Its bounded native Linux installed-metadata component is implemented in scripts/collect_linux.py; the coordinator supplies caller authorization and private evidence handling. Approved system changes still use reviewed official tools through the coordinator; these helpers are not a general Linux updater or repair executor. Reviewed against official documentation on 2026-10-23 at 19:11 UTC. Refresh release, lifecycle and advisory evidence during each run. The toolkit's root instructions, approved scope and action ledger govern this adapter. Examples describe capabilities; they are not an approved batch to execute.

On this page
On this page

Start PatchCairn on Linux

From the source root, use an existing supported Python 3.12+ interpreter:

python3 -I -S -B scripts/patchcairn_workflow.py

The default command, PatchCairn: start without a job, and help display the standard menu without creating a session or collecting host information. The namespaced requests belong in the coordinator's chat; they are not standalone Bash commands. A terminal uses the Python helper shown above. Choose a job, control style, timing and checkpoints through that menu. A job record still grants no collection or mutation authority. See the first-session guide and workflow contract.

Private records need actual effective-user ownership and directory/file modes 0700/0600 on an admitted native filesystem. The initial Linux privacy checker supports little-endian x86-64 LP64 with glibc 2.x, and admits ext2/3/4, XFS, Btrfs, tmpfs and ramfs. Other ABIs, unavailable primitives and unknown, network, FUSE, NTFS-emulated or Windows-mounted/9p filesystems cause a hold. Reported mode metadata alone is not proof of privacy. See the exact private-storage boundary.

WSL itself is not rejected: a supported native Linux filesystem within WSL can meet the same requirements. On a Windows-mounted WSL folder, the private-storage hold is expected while the read-only menu remains available. Do not weaken checks, repair an existing store's permissions, remount a filesystem or relocate development fixtures to manufacture a pass. Existing unsafe stores remain held without adoption.

The conversation workflow is the single start for all four jobs. scripts/patchcairn.py supplies assessment-record utilities for the coordinator, rather than another product or first-run choice. Internal backend and schema markers identify which component can handle an existing record; they are not product versions. Keep those markers unchanged, do not automatically convert incompatible records, and never promote a fictional record into a real one.

Implemented collection and test boundary

1. Establish the environment before assessment

2. Collect bounded installation metadata

Use known system installation databases and owner-approved manager scopes. Do not recursively search home directories, project trees, mounted drives or private environment files. Resolve each proposed executable to its installation owner before choosing an update route. Identical product names can represent separate installations. Keep public version facts separate from private paths, device identifiers, usernames and repository credentials. Suppress sensitive values before recording output.

Ecosystem Useful assessment capability Important boundary
Debian/Ubuntudpkg-query installed name/version/architecture/status; dpkg -S for ownership of an exact known file; cached APT candidate/policy and hold informationAn installed record differs from a removed package with remaining configuration. Cached candidates can be stale. [S2]
RPM distributionsrpm -q / rpm -qa installed package metadata; rpm -qf for an exact known filePreserve epoch, version, release and architecture; do not reduce a distribution package to its upstream version. Consult the installed RPM manual.
DNF4/DNF5Capability-matched installed-package and advisory queries; record manager version, repository/channel and exclusionsDNF5 and DNF4 options are not interchangeable. Query commands can involve caches; use the installed version's documented cache-only mode when appropriate and record freshness limits. [S3]
FlatpakInstalled application/runtime IDs, architecture, branch and commit; distinguish user and system scopePreserve the app/runtime relationship and configured origin. A system-scope query does not cover every user's installation. [S4]
SnapInstalled name, revision, tracking channel, publisher and hold notesSnaps have independent refresh state. A targeted refresh can bypass a hold, so held items need explicit plan review. [S5]
Manual/vendor installationExact known binary or package metadata, owner and official updater capabilityUnknown origin or missing ownership means hold; do not replace it with a similarly named package.

APT index refresh, DNF metadata refresh and online update-offer queries are separate operations from a strictly local inventory. Package managers and daemons may write native caches, logs or telemetry even for queries. Do not promise that their side effects stay inside the toolkit folder. If a query cannot satisfy the approved write boundary, mark it unavailable and explain the narrower evidence collected. Do not dump full repository configuration: private repository URLs may contain credentials or identify an organization. Do not acquire locks, kill an updater, remove lock files, stop automatic updates or run two package transactions in parallel.

3. Research applicable vulnerabilities and support

4. Keep runtime ownership and compatibility intact

Runtime Assessment and update decision
Distribution PythonKeep the interpreter and libraries under the distribution package manager. Do not replace the OS interpreter, rewrite system symlinks or install into it with privileged pip.
uv-managed PythonSeparate managed interpreters from system/distribution installations. An installed-only query can identify managed copies without a broad project scan. uv's downloadable-version catalogue is tied to its release. [S7]
Virtual environmentsRecord only explicitly approved environments and their base interpreter. Their packages and interpreter relationships are distinct; upgrading one global Python does not establish every environment is patched. [S7, S8]
Node.jsDistinguish distribution, vendor, version-manager, user-prefix and application-bundled copies. Determine the exact selected executable and package-manager prefix without printing configuration or credentials.
JavaIdentify each JDK/JRE's distribution, major version, architecture and owner. A newer side-by-side JDK does not satisfy applications pinned to another major release. Do not change system alternatives globally as a routine update.
.NETDistinguish SDKs, runtimes, package feeds, Snap/manual installs and application-bundled copies. Microsoft documents different distribution-provided and Microsoft-provided sources; retain the existing appropriate ownership route. [S9]

For uv, supported patch upgrades differ from minor-version migration; explicitly pinned environments can remain on older patches. Retained versions require assessment, not automatic deletion. [S7] A Python environment is generally recreated from its dependency definition when relocated; do not assume a copied environment is a portable backup. [S8] Project dependency changes, lockfile rewrites, environment rebuilds and application source changes require their own scope and validation plan. Do not run unknown interpreter binaries simply to obtain a version; establish provenance and whether startup could execute local customization first. Application-bundled runtimes belong to the application publisher. Keep their findings open rather than replacing internal files manually.

5. Plan and execute approved changes

  1. Refresh current official guidance; show exact installation target, channel, publisher, compatibility constraints, expected downtime and verification method.
  2. Model package dependencies and inspect the proposed transaction with a documented simulation or non-accepting preview where supported. Treat the preview as a prediction with a time limit, not a guarantee.
  3. Disclose package-manager writes outside the executing toolkit root's work/ directory, including installed locations, native logs, indexes and download caches. Toolkit-generated evidence and helpers remain inside that work/ directory.
  4. Check free space, power, concurrent package activity and recovery readiness using bounded evidence. A recovery plan must be specific; do not promise that every package downgrade is supported.
  5. Use the approved distribution/vendor channel. Execute one bounded transaction, capture its exact exit status, affected packages and redacted output, then verify before the next transaction.
  6. Let the owner handle normal sudo, polkit or graphical authentication. Never request, record, type or pipe a password; never weaken authentication to automate the step.
  7. Stop on unexpected removals, vendor switches, dependency conflicts, configuration-file questions, signature failures, unavailable sources or changed targets. Explain choices and consequences in the chat.
  8. Preserve active application data and services. A service restart, session termination or system reboot needs the approved interruption boundary and saved-work check.
  9. Re-read installed versions and test a narrowly scoped application capability. Check whether running processes still use old libraries and whether the active kernel differs from the newly installed kernel.
  10. Record a reboot as pending until observed after the owner-approved restart. Installed kernel packages alone do not prove the running kernel changed.

Honor package holds, repository priorities, stream/module selection and phased rollouts. Ubuntu explains that held-back packages can reflect phased delivery; do not force a candidate or override policy to reduce a report count. [S10] Distribution release upgrades, testing-channel migrations, firmware, bootloader repair and Secure Boot changes are separate high-impact plans. They must not run unattended as ordinary patching. If no supported safe update exists, document exposure, an evidence-backed mitigation or publisher dependency. Do not conceal the unresolved item. Computer use is a fallback for supported desktop tools when CLI/API routes are insufficient; choose only controls grounded in fresh UI state and pause for inaccessible authentication.

6. Diagnose before repairing

7. WSL is a separate boundary

Host WSL version, WSL1/WSL2 choice, guest distribution release, guest packages and host Windows servicing are separate ledger items. [S12] Updating WSL does not update every guest package; updating a guest does not patch the Windows host. Do not equate a guest kernel package with the kernel actually used by WSL2. wsl --list --verbose describes installed distributions, state and WSL generation; it does not authorize guest startup or expose a complete guest software inventory. [S12] Never unregister, reset, export/import, convert generations or run wsl --shutdown during routine assessment. Those actions can remove data, terminate work or change architecture and need a separate plan.

8. Finish and clean only owned work

Save private machine evidence only in the executing toolkit root's admitted work/ namespaces; keep public reference documentation free of machine facts and credentials. Conversation sessions and their service, diagnostic and storage evidence remain separately bound internal stores. Assessment-record utilities keep each record run in work/<run-id>/. Internal compatibility markers, ownership and scope determine which component may handle those records; the stores and their cleanup authority are not interchangeable. After reconciliation and approved retention decisions, the coordinator uses only the supported exact cleanup operation for positively identified toolkit-generated disposable files. Completed assessment-record run deletion is narrow housekeeping, not a general session or evidence-store deletion API. Required recovery and unresolved records stay protected. Follow recovery and cleanup, rather than treating a work/ parent as deletion authority. Reject symlinks, traversal, unexpected mounts, empty/root targets and ownership mismatches; preview exact resolved targets before removal. Browser profiles, cookies, cache and history; saved chat/development sessions; project environments, datasets and application state are excluded from cleanup. Do not run generic home/cache sweeps, package autoremove, journal vacuum, Snap revision deletion, Flatpak unused-runtime removal or container pruning as end-of-run cleanup. Native package logs and caches outside the run are not toolkit-owned trash. Any separate cleanup requires an evidence-backed plan, exact scope and approval.

Official sources

All links below were accessed on 2026-10-23 UTC; installed versions may have different capabilities from the current documentation.

Developed by Michael. Private session records belong locally under work/; this public guide contains no live computer records.