Files
soda64 8bec4ed932
Build and Publish Release / Build Packages and Publish (push) Successful in 27s
feat: release v2.0.0 with tab completion, package filtering, db health checks, flatpak and logrotate
2026-10-03 08:31:00 +02:00

213 lines
7.4 KiB
Markdown

# Linux System Updater: User Guide
Welcome to the **Linux System Updater** (`linux-updater`) User Guide. This guide covers how to safely inspect and update your Linux workstation or server using `linux-updater`.
---
## 1. Overview & Philosophy
Updating a Linux system can occasionally fail due to preventable conditions:
- `/boot` partition running out of inodes or disk space during kernel installation.
- Leftover package manager lock files from crashed background processes.
- Memory exhaustion causing package compilers or post-install scripts to fail.
- Sudden laptop power loss during critical package unpacking.
`linux-updater` acts as an intelligent safety wrapper around your system's native package manager (`apt`, `dnf`, or `pacman`). Before making any modifications, it verifies that the system is in a healthy, safe state to upgrade.
---
## 2. Interactive CLI Workflow
### Checking System Health (`health`)
To run a fast pre-flight diagnostic without checking for updates or altering system state:
```bash
linux-updater health
```
**Example Output:**
```text
Linux System Updater v2.0.0
Detected System: Ubuntu 24.04.1 LTS (Family: debian)
Pre-flight Health Diagnostics:
-----------------------------------------------------------------
[ PASS ] disk_boot /boot free space is sufficient: 1042MB
[ PASS ] disk_var /var free space is sufficient: 42100MB
[ PASS ] disk_root Root filesystem free space is sufficient: 42100MB
[ PASS ] lock_lock-frontend No lock active at /var/lib/dpkg/lock-frontend
[ PASS ] lock_lock No lock active at /var/lib/dpkg/lock
[ PASS ] lock_lock No lock active at /var/lib/apt/lists/lock
[ PASS ] memory_available Available RAM is sufficient: 7850MB
[ PASS ] pending_reboot No pending system reboot detected.
[ PASS ] package_db Package database is consistent.
-----------------------------------------------------------------
Overall Pre-flight Status: PASSED
```
### Checking for Available Updates (`check`)
To see which packages have upgrades available without installing anything:
```bash
linux-updater check
```
**Example Output:**
```text
Linux System Updater v2.0.0
Detected System: Fedora Linux 40 (Family: rhel)
Checking available updates...
Available Updates (3):
-----------------------------------------------------------------
• openssl.x86_64 1:3.0.7-27 -> 1:3.0.7-28 (baseos)
• nginx.x86_64 1.24.0-1 -> 1.24.0-2 (updates)
• curl.x86_64 8.2.1-1 -> 8.2.1-2 (updates)
-----------------------------------------------------------------
Run 'linux-updater update' to apply updates.
```
### Applying Routine System Updates (`update`)
To apply routine package upgrades interactively:
```bash
sudo linux-updater update
```
1. **Pre-flight Checks:** Checks `/boot`, `/var`, `/`, locks, RAM, and power.
2. **Review:** Shows list of available updates.
3. **Confirmation:** Prompts `Proceed with updates? [Y/n]: `
4. **Execution:** Runs native package upgrade transaction with real-time download and installation streaming.
5. **Reboot Management:**
- **Interactive prompt:** If a kernel or core library update requires a reboot, `linux-updater` asks:
`A system reboot is required to apply changes. Reboot now? [y/N]: `
(Pressing Enter defaults safely to `No`).
- **Automated reboot:** Pass `--reboot` to automatically trigger reboot upon successful updates:
`sudo linux-updater update -y --reboot`
### Selective Package Updates (`--packages`)
If you only want to upgrade specific software (e.g. security patches for OpenSSL and Nginx) without touching the rest of the operating system:
```bash
sudo linux-updater update --packages openssl nginx
```
### Security-Only Updates (`--security`)
To restrict updates solely to security patches and CVE advisories (supported on RHEL, Fedora, CentOS, Rocky, AlmaLinux, Debian, and Ubuntu):
```bash
sudo linux-updater update --security
```
### Excluding Packages (`--exclude`)
To exclude specific packages or glob patterns from being upgraded (e.g., pinning kernels, proprietary drivers, or database servers):
```bash
sudo linux-updater update --exclude "kernel*" "nvidia*"
```
### Flatpak Application Updates (`--flatpak`)
If you use Flatpak for desktop applications or isolated utilities, pass `--flatpak` to automatically update all Flatpaks after operating system packages have updated:
```bash
sudo linux-updater update --flatpak
```
### Shell Tab Autocompletion (`completion`)
`linux-updater` provides zero-latency static tab completion for both Bash and Zsh. Subcommands, flags, and JSON configuration files auto-complete upon pressing `<Tab>`:
```bash
# Enable completion in current Bash shell:
eval "$(linux-updater completion bash)"
# Enable completion in current Zsh shell:
eval "$(linux-updater completion zsh)"
# Permanently install into user profile:
linux-updater completion bash >> ~/.bashrc
linux-updater completion zsh >> ~/.zshrc
```
### Simulation / Dry Run (`--dry-run`)
To simulate the complete update transaction without changing package states:
```bash
linux-updater update --dry-run
```
---
## 3. Major Distribution Release Upgrade (`release-upgrade`)
A major distribution upgrade transitions your system from one release version to the next (e.g., Ubuntu 22.04 LTS to 24.04 LTS, Debian 12 to 13, Fedora 43 to 44, or AlmaLinux 8 to 9).
### Target Release Specification (`-t` / `--releasever`)
On Fedora and Red Hat-based systems, you must specify the target release version. Both `-t` and `--releasever` are supported:
```bash
# Fedora: upgrade to version 44:
sudo linux-updater release-upgrade -t 44
sudo linux-updater release-upgrade --releasever 44
# With automated offline transaction reboot:
sudo linux-updater release-upgrade -t 44 --reboot
```
Because major upgrades modify thousands of core system packages, `linux-updater` introduces strict safety gates:
```bash
# Simulate upgrade first:
linux-updater release-upgrade --dry-run -t 44
# Execute real upgrade:
sudo linux-updater release-upgrade -t 44
```
**Safety Banner:**
```text
=================================================================
WARNING: MAJOR DISTRIBUTION RELEASE UPGRADE
=================================================================
Target Release: 44
This operation performs a major upgrade of core system components.
Ensure you have a recent system backup or snapshot before proceeding.
=================================================================
Are you absolutely sure you want to proceed with upgrade to 44? [y/N]:
```
**Fedora Offline Upgrades:**
On Fedora, major release upgrades are downloaded as an offline transaction. Once download finishes:
- With `--reboot`: Automatically executes `dnf5 -y offline reboot` (or `dnf -y system-upgrade reboot`).
- Interactively: Prompts `A system reboot is required to execute the offline upgrade transaction. Reboot now? [y/N]: `.
---
## 4. System Cleanup (`clean`)
To recover disk space occupied by old downloaded package files:
```bash
# Clean package download cache:
sudo linux-updater clean
# Clean cache AND remove orphaned dependencies:
sudo linux-updater clean --all
```
---
## 5. Reading System Logs
All execution logs are recorded in `/var/log/linux-updater/`:
```bash
# View the log from the most recent run:
cat /var/log/linux-updater/latest.log
# List historical execution logs:
ls -lh /var/log/linux-updater/
```
Each log line includes timestamped records of commands executed, exit codes, and diagnostics.