feat: release v2.0.0 with tab completion, package filtering, db health checks, flatpak and logrotate
Build and Publish Release / Build Packages and Publish (push) Successful in 27s

This commit is contained in:
soda64 committed 2026-10-03 08:31:00 +02:00
1 parent 8d4157b42d
commit 8bec4ed932
27 files changed
+1053 -69

No files matched your search

+36 -16
View File
@@ -14,19 +14,27 @@
- **Pre-flight Health Diagnostics:**
- **Disk Space:** Enforces safety thresholds on `/boot` (>= 250 MB), `/var` (>= 1024 MB), and `/` (>= 1024 MB).
- **Process Locks:** Detects active package manager locks (via PID checking and non-blocking `fcntl.flock` advisory locks).
- **Package Database Consistency:** Verifies package manager integrity (`dpkg --audit`, `dnf check`, `pacman` lock integrity) and auto-remediates interrupted transactions (`dpkg --configure -a`, `apt-get install -f`, `dnf clean all`).
- **Memory & OOM Pressure:** Inspects `/proc/meminfo` to warn or halt if available RAM is dangerously low (< 300 MB).
- **AC Power Protection:** Inspects `/sys/class/power_supply` on laptops to prevent updates on battery power.
- **Reboot Detection:** Detects pending reboots from previous kernel/library updates.
- **Safe Automated Remediation:** Safely cleans package cache when `/var` is low and clears stale locks if the holder process is confirmed dead.
- **Safe Automated Remediation:** Safely cleans package cache when `/var` is low, clears stale locks if the holder process is dead, and repairs interrupted package transactions.
- **Advanced Update Capabilities:**
- **Security-only Updates:** `--security` flag restricts updates strictly to CVE/security advisories on RHEL, Fedora, CentOS, Rocky, AlmaLinux, Debian, and Ubuntu.
- **Package Filtering:** `--exclude` skips specified packages or glob patterns (e.g., `--exclude "kernel*" "nginx"`).
- **Selective Packages:** `--packages` selectively targets specific packages for updates.
- **Flatpak Integration:** `--flatpak` triggers Flatpak application updates after OS packages.
- **Shell Tab Autocompletion:** Native, zero-latency Bash and Zsh completions with instant flag/subcommand suggestions (`linux-updater completion bash|zsh`).
- **Two Update Tiers:**
- `update`: Routine updates (with optional selective package targeting via `--packages`).
- `update`: Routine updates with security filters, exclusions, and Flatpak support.
- `release-upgrade`: Major distribution upgrades (e.g. Debian 12 $\rightarrow$ 13, Ubuntu 22.04 $\rightarrow$ 24.04, Fedora 40 $\rightarrow$ 41, or RHEL/AlmaLinux `leapp` upgrades) with safety warnings.
- **Standard Linux FHS Logging:**
- **Standard Linux FHS Logging & Logrotate:**
- Logs transactions to `/var/log/linux-updater/linux-updater-<YYYYMMDD>-<HHMMSS>.log`.
- Atomically maintains `/var/log/linux-updater/latest.log` symlink pointing to the most recent execution.
- Atomically maintains `/var/log/linux-updater/latest.log` symlink.
- Ships with `/etc/logrotate.d/linux-updater` (weekly rotation, 4 copies, compressed).
- **Automation Ready:**
- Structured `--json` output for Zabbix, Wazuh, Prometheus node exporters, or custom agents.
- Non-interactive mode (`-y` / `--non-interactive`) for cron and systemd timers.
- Non-interactive mode (`-y` / `--non-interactive`) for cron, Ansible, and central management.
- Deterministic exit codes.
---
@@ -49,7 +57,7 @@
python3 packaging/build_packages.py
# Install generated deb:
sudo dpkg -i dist/linux-updater_1.3.0_all.deb
sudo dpkg -i dist/linux-updater_2.0.0_all.deb
```
### Option 2: Native `.rpm` Package (RHEL / Fedora / AlmaLinux / Rocky)
@@ -63,8 +71,8 @@ sudo rpm -Uvh dist/rpm/RPMS/noarch/linux-updater-*.noarch.rpm
### Option 3: Standalone Tarball (All Linux Distributions)
```bash
tar -xzf dist/linux-updater-1.3.0.tar.gz
cd linux-updater-1.3.0
tar -xzf dist/linux-updater-2.0.0.tar.gz
cd linux-updater-2.0.0
sudo ./install.sh
```
@@ -91,20 +99,29 @@ sudo linux-updater update
# 6. Apply updates non-interactively with automated reboot:
sudo linux-updater update -y --reboot
# 7. Selectively update specific packages:
# 7. Apply security-only updates non-interactively:
sudo linux-updater update -y --security
# 8. Exclude specific packages or glob patterns:
sudo linux-updater update -y --exclude "kernel*" "nginx"
# 9. Update system packages and Flatpak apps:
sudo linux-updater update -y --flatpak
# 10. Selectively update specific packages:
sudo linux-updater update -y --packages openssl nginx
# 8. Major distribution release upgrade (interactive confirmation & prompt for reboot):
# 11. Major distribution release upgrade (interactive confirmation & prompt for reboot):
sudo linux-updater release-upgrade -t 44
# 9. Major release upgrade with alias syntax and automated reboot:
# 12. Major release upgrade with alias syntax and automated reboot:
sudo linux-updater release-upgrade --releasever 44 --reboot
# 10. Simulate major distribution release upgrade:
sudo linux-updater release-upgrade --dry-run -t 44
# 11. Clean package cache and remove orphaned packages:
# 13. Clean package cache and remove orphaned packages:
sudo linux-updater clean --all
# 14. Enable Bash or Zsh tab autocompletion:
eval "$(linux-updater completion bash)"
```
---
@@ -126,7 +143,10 @@ Default settings can be customized in `/etc/linux-updater.json`:
"non_interactive": false,
"check_ac_power": true,
"clean_after_update": false,
"auto_reboot": false
"auto_reboot": false,
"exclude_packages": [],
"security_only": false,
"update_flatpak": false
},
"logging": {
"log_dir": "/var/log/linux-updater",