fedora-immutable-cheatsheet/README.md
2023-10-23 21:46:07 +02:00

2.6 KiB

fedora-immutable-cheatsheet

A cheatsheet for immutable fedora variants, usually about ostree and rpm-ostree

System files health checking

Finding all damaged objects. --delete flag will delete corrupted files and mark commits with damaged files as "partial", which then allow to redownload it.

ostree fsck -a

Current deployment status

rpm-ostree status

Emergency fallback

falling back to any previous commit of the system branch

  1. Download last 5 commits (parameter --commit-metadata-only is optional but makes things faster)
ostree pull --commit-metadata-only --depth 5 fedora fedora/38/x86_64/kinoite
  1. (Optionally) pin current deployment if there is chance of need to return to it. 0 is index of current deployment. to list deploymends run rpm-ostree status or ostree admin status
ostree admin pin 0
  1. List downloaded commits to choose the best one, basing on the timestamp or anything elese
ostree log fedora/38/x86_64/kinoite
  1. Deploy selected commit using its hash (or version, like 38.20231008.0)
rpm-ostree deploy 520e744c643b85fd14817a3eb948f200e7dec902cad4157e411dfeda2c6d7aab
  1. Reboot into the new deoloyment (to see it before reboot, run rpm-ostree status)

  2. (Optionally) unpin previously pinned deployment (id will be 1 if it is listed as the one before currently booted one)

ostree admin pin -u 1

Rebase into different tree (also for switching flavors of the distro)

  1. List trees of the ostree repository (fedora example)
ostree remote summary fedora
  1. Rebase the system into the selected tree
rpm-ostree rebase fedora/39/x86_64/kinoite
  1. reboot into the new deployment

cleaning

Main tool for cleanup is rpm-ostree cleanup command. To see all options run:

rpm-ostree cleanup --help

Full cleanup (including all deployments other than currently deployed)

rpm-ostree cleanup -p -b -r -m

ostree also have cleaning tool

ostree prune

Managing packages deployed with system

Adding package fzf to the (new) deployment

rpm-ostree install fzf

Removing packgage that was additionally installed

rpm-ostree remove fzf

Removing package that is in the system by default

rpm-ostree override remove firefox

Restore default package that was removed with override

rpm-ostree override reset firefox

Other

Allow system modification

Temporarily

rpm-ostree usroverlay --transient

Make the changes to /usr persist reboots

rpm-ostree usroverlay --hotfix