Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab50abe0c0 |
No files matched your search
@@ -49,7 +49,7 @@
|
||||
python3 packaging/build_packages.py
|
||||
|
||||
# Install generated deb:
|
||||
sudo dpkg -i dist/linux-updater_1.1.0_all.deb
|
||||
sudo dpkg -i dist/linux-updater_1.2.0_all.deb
|
||||
```
|
||||
|
||||
### Option 2: Native `.rpm` Package (RHEL / Fedora / AlmaLinux / Rocky)
|
||||
@@ -63,8 +63,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.1.0.tar.gz
|
||||
cd linux-updater-1.1.0
|
||||
tar -xzf dist/linux-updater-1.2.0.tar.gz
|
||||
cd linux-updater-1.2.0
|
||||
sudo ./install.sh
|
||||
```
|
||||
|
||||
@@ -85,19 +85,25 @@ linux-updater check
|
||||
# 4. Simulate a routine system update (dry run):
|
||||
linux-updater update --dry-run
|
||||
|
||||
# 5. Apply routine updates interactively (with confirmation prompt):
|
||||
# 5. Apply routine updates interactively (prompts for reboot if required):
|
||||
sudo linux-updater update
|
||||
|
||||
# 6. Apply updates non-interactively (e.g. from cron or Ansible):
|
||||
sudo linux-updater -y update
|
||||
# 6. Apply updates non-interactively with automated reboot:
|
||||
sudo linux-updater update -y --reboot
|
||||
|
||||
# 7. Selectively update specific packages:
|
||||
sudo linux-updater -y update --packages openssl nginx
|
||||
sudo linux-updater update -y --packages openssl nginx
|
||||
|
||||
# 8. Simulate major distribution release upgrade:
|
||||
sudo linux-updater release-upgrade --dry-run -t 41
|
||||
# 8. Major distribution release upgrade (interactive confirmation & prompt for reboot):
|
||||
sudo linux-updater release-upgrade -t 44
|
||||
|
||||
# 9. Clean package cache and remove orphaned packages:
|
||||
# 9. 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:
|
||||
sudo linux-updater clean --all
|
||||
```
|
||||
|
||||
@@ -119,7 +125,8 @@ Default settings can be customized in `/etc/linux-updater.json`:
|
||||
"auto_remediate": true,
|
||||
"non_interactive": false,
|
||||
"check_ac_power": true,
|
||||
"clean_after_update": false
|
||||
"clean_after_update": false,
|
||||
"auto_reboot": false
|
||||
},
|
||||
"logging": {
|
||||
"log_dir": "/var/log/linux-updater",
|
||||
@@ -137,9 +144,9 @@ CLI flags always take precedence over configuration file values.
|
||||
|
||||
| Code | Status | Meaning |
|
||||
|---|---|---|
|
||||
| `0` | **Success** | All operations completed cleanly; no reboot required. |
|
||||
| `0` | **Success** | All operations completed cleanly (or automated reboot successfully initiated). |
|
||||
| `1` | **Error** | Pre-flight check failed and unrecovered, or package manager command returned non-zero. |
|
||||
| `2` | **Reboot Required** | Operation succeeded, but a system reboot is required (kernel or core library updated). |
|
||||
| `2` | **Reboot Required** | Operation succeeded, but a system reboot is required (and `--reboot` was not supplied). |
|
||||
| `3` | **Aborted** | User cancelled operation at interactive confirmation prompt. |
|
||||
|
||||
---
|
||||
|
||||
@@ -149,6 +149,6 @@ python3 packaging/build_packages.py
|
||||
```
|
||||
|
||||
Generated artifacts:
|
||||
- `dist/linux-updater-1.1.0.tar.gz`: Standalone distribution archive containing `install.sh`.
|
||||
- `dist/linux-updater_1.1.0_all.deb`: Native Debian/Ubuntu binary package.
|
||||
- `dist/rpm/RPMS/noarch/linux-updater-1.1.0-1.*.noarch.rpm`: Native RPM package.
|
||||
- `dist/linux-updater-1.2.0.tar.gz`: Standalone distribution archive containing `install.sh`.
|
||||
- `dist/linux-updater_1.2.0_all.deb`: Native Debian/Ubuntu binary package.
|
||||
- `dist/rpm/RPMS/noarch/linux-updater-1.2.0-1.*.noarch.rpm`: Native RPM package.
|
||||
+31
-9
@@ -27,7 +27,7 @@ linux-updater health
|
||||
|
||||
**Example Output:**
|
||||
```text
|
||||
Linux System Updater v1.1.0
|
||||
Linux System Updater v1.2.0
|
||||
Detected System: Ubuntu 24.04.1 LTS (Family: debian)
|
||||
|
||||
Pre-flight Health Diagnostics:
|
||||
@@ -53,7 +53,7 @@ linux-updater check
|
||||
|
||||
**Example Output:**
|
||||
```text
|
||||
Linux System Updater v1.1.0
|
||||
Linux System Updater v1.2.0
|
||||
Detected System: Fedora Linux 40 (Family: rhel)
|
||||
Checking available updates...
|
||||
|
||||
@@ -76,8 +76,13 @@ 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.
|
||||
5. **Reboot Notice:** Warns if a kernel or core library update requires a reboot.
|
||||
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:
|
||||
@@ -97,16 +102,28 @@ 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 40 to 41, or AlmaLinux 8 to 9).
|
||||
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 41
|
||||
linux-updater release-upgrade --dry-run -t 44
|
||||
|
||||
# Execute real upgrade:
|
||||
sudo linux-updater release-upgrade -t 41
|
||||
sudo linux-updater release-upgrade -t 44
|
||||
```
|
||||
|
||||
**Safety Banner:**
|
||||
@@ -114,14 +131,19 @@ sudo linux-updater release-upgrade -t 41
|
||||
=================================================================
|
||||
WARNING: MAJOR DISTRIBUTION RELEASE UPGRADE
|
||||
=================================================================
|
||||
Target Release: 41
|
||||
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 41? [y/N]:
|
||||
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`)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Linux System Updater - Multi-distribution system updater and health checker."""
|
||||
|
||||
__version__ = "1.1.0"
|
||||
__version__ = "1.2.0"
|
||||
__author__ = "Test Factory"
|
||||
@@ -74,8 +74,10 @@ Examples:
|
||||
linux-updater check # Check for available updates without applying
|
||||
sudo linux-updater update # Update system packages interactively
|
||||
sudo linux-updater update -y # Non-interactive automated update
|
||||
sudo linux-updater update -y --reboot # Automated update with automatic reboot
|
||||
sudo linux-updater update --packages curl # Selectively update specific package(s)
|
||||
sudo linux-updater release-upgrade -t 44 # Upgrade distribution release (Fedora/RHEL/Debian/Ubuntu)
|
||||
sudo linux-updater release-upgrade -t 44 --reboot # Major upgrade with automated reboot
|
||||
sudo linux-updater clean --all # Clean package cache and unused dependencies
|
||||
|
||||
Subcommand Help:
|
||||
@@ -103,6 +105,7 @@ Subcommand Help:
|
||||
Examples:
|
||||
sudo linux-updater update
|
||||
sudo linux-updater update -y
|
||||
sudo linux-updater update -y --reboot
|
||||
sudo linux-updater update --dry-run
|
||||
sudo linux-updater update --packages nginx redis
|
||||
""",
|
||||
@@ -141,11 +144,12 @@ Target Release Specification:
|
||||
Both '-t / --target-release' and '--releasever' are supported.
|
||||
|
||||
Examples:
|
||||
sudo linux-updater release-upgrade -t 44 # Fedora: upgrade to version 44
|
||||
sudo linux-updater release-upgrade --releasever 44 # Fedora: alias syntax
|
||||
sudo linux-updater release-upgrade -t 24.04 # Ubuntu/Debian: upgrade to 24.04
|
||||
sudo linux-updater release-upgrade -t 9 # AlmaLinux / Rocky: upgrade to EL 9
|
||||
sudo linux-updater release-upgrade -t 44 --dry-run # Simulate upgrade without applying
|
||||
sudo linux-updater release-upgrade -t 44 # Fedora: upgrade to version 44
|
||||
sudo linux-updater release-upgrade -t 44 --reboot # Fedora: upgrade with automated offline reboot
|
||||
sudo linux-updater release-upgrade --releasever 44 # Fedora: alias syntax
|
||||
sudo linux-updater release-upgrade -t 24.04 # Ubuntu/Debian: upgrade to 24.04
|
||||
sudo linux-updater release-upgrade -t 9 # AlmaLinux / Rocky: upgrade to EL 9
|
||||
sudo linux-updater release-upgrade -t 44 --dry-run # Simulate upgrade without applying
|
||||
""",
|
||||
)
|
||||
release_parser.add_argument(
|
||||
|
||||
+5
-1
@@ -1,4 +1,4 @@
|
||||
.TH LINUX-UPDATER 8 "October 2026" "linux-updater 1.1.0" "System Administration Utilities"
|
||||
.TH LINUX-UPDATER 8 "October 2026" "linux-updater 1.2.0" "System Administration Utilities"
|
||||
.SH NAME
|
||||
linux-updater \- unified, safe multi-distribution Linux system update utility
|
||||
|
||||
@@ -7,6 +7,7 @@ linux-updater \- unified, safe multi-distribution Linux system update utility
|
||||
[\fB\-y\fR|\fB\-\-yes\fR]
|
||||
[\fB\-c\fR \fICONFIG\fR]
|
||||
[\fB\-\-dry\-run\fR]
|
||||
[\fB\-\-reboot\fR]
|
||||
[\fB\-\-no\-remediation\fR]
|
||||
[\fB\-\-skip\-preflight\fR]
|
||||
[\fB\-v\fR|\fB\-\-verbose\fR]
|
||||
@@ -59,6 +60,9 @@ Specifies the path to an alternative JSON configuration file (default: \fI/etc/l
|
||||
.B \-\-dry\-run
|
||||
Simulates update operations without altering package states on disk.
|
||||
.TP
|
||||
.B \-\-reboot
|
||||
Automatically reboots the system after a major release upgrade or routine update (if a reboot is required). On Fedora release upgrades, automatically executes offline transaction reboot (\fBdnf5 \-y offline reboot\fR). In interactive mode when this option is omitted, the user is prompted to confirm immediate reboot.
|
||||
.TP
|
||||
.B \-\-no\-remediation
|
||||
Disables automated remediation actions (such as clearing package caches or unlinking stale locks).
|
||||
.TP
|
||||
|
||||
@@ -67,7 +67,7 @@ class PackageBuilder:
|
||||
self,
|
||||
source_root: Optional[Path] = None,
|
||||
output_dir: Optional[Path] = None,
|
||||
version: str = "1.1.0",
|
||||
version: str = "1.2.0",
|
||||
) -> None:
|
||||
self.source_root = source_root or Path(__file__).resolve().parent.parent
|
||||
self.output_dir = output_dir or (self.source_root / "dist")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Name: linux-updater
|
||||
Version: 1.1.0
|
||||
Version: 1.2.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Unified, safe multi-distribution Linux system updater
|
||||
|
||||
@@ -46,6 +46,10 @@ fi
|
||||
%{_mandir}/man8/linux-updater.8*
|
||||
|
||||
%changelog
|
||||
* Fri Oct 02 2026 Test Factory <admin@localhost> - 1.2.0-1
|
||||
- Fix dnf5 offline reboot and dnf system-upgrade reboot automatic invocation with -y.
|
||||
- Enhanced cross-distribution unattended update and reboot workflows.
|
||||
|
||||
* Fri Oct 02 2026 Test Factory <admin@localhost> - 1.1.0-1
|
||||
- Real-time download/transaction streaming without stdin hangs.
|
||||
- Automated and interactive reboot support (--reboot and [y/N] prompt).
|
||||
|
||||
@@ -12,7 +12,7 @@ class TestPackaging(unittest.TestCase):
|
||||
self.temp_dir = tempfile.TemporaryDirectory()
|
||||
self.out_dir = Path(self.temp_dir.name)
|
||||
self.root_dir = Path(__file__).resolve().parent.parent
|
||||
self.builder = PackageBuilder(source_root=self.root_dir, output_dir=self.out_dir, version="1.1.0")
|
||||
self.builder = PackageBuilder(source_root=self.root_dir, output_dir=self.out_dir, version="1.2.0")
|
||||
|
||||
def tearDown(self):
|
||||
self.temp_dir.cleanup()
|
||||
|
||||
Reference in new issue
Block a user