Part of the zsh-opensuse-tumbleweed plugin ecosystem — a collection of tools and Oh My Zsh plugins built for daily openSUSE Tumbleweed administration.
This repository provides two companion scripts:
zypper-history— audit tool that parses/var/log/zypp/historywith color-coded output, filters, package search, statistics, and retroactive downgrade detectionzyp-dup—zypper dupwrapper that runs a dry-run first, detects downgrades / vendor changes / removals before they happen, and logs everything for later review
- Date-based filtering — query any date, or default to today
- Available dates listing — view all days with recorded zypper activity before selecting
- Color-coded output — actions (install/remove) and repositories highlighted with distinct ANSI colors
- Dynamic repository coloring — detects all configured repositories at runtime, assigns unique colors automatically
- Install / remove filters —
-ior-rto show only one action type - Package search —
-p NAMEsearches the entire history across all dates - Last N days —
-l Ndisplays the N most recent days of activity in one pass - Global statistics —
-sshows totals, top 10 installed/removed packages, activity per repository and per day - Retroactive downgrade detection —
-g [N]finds packages removed and reinstalled on the same day (heuristic), over the N last active days - zyp-dup log viewer —
-Gopens/var/log/zypper-changes-detailed.log(written byzyp-dup) inless -R - Repository add/remove display —
raddandrremoveevents shown as a dedicated DÉPÔTS section - CSV export — generate structured reports saved to
~/Audits/with permissions600 - Paginated display — output piped through
less -Rwith search support - Root check with sudo fallback — prompts for privilege escalation if needed
- Strict date validation — rejects malformed or future dates
zypper-history # Interactive mode (default)
zypper-history -d YYYY-MM-DD # Specific date directly
zypper-history -i [-d DATE] # Installs only
zypper-history -r [-d DATE] # Removals only
zypper-history -p curl # Search package across entire history
zypper-history -l 7 # Last 7 active days
zypper-history -s # Global statistics
zypper-history -g # Retroactive downgrade detection (last 30 active days)
zypper-history -g 60 # Same, over 60 active days
zypper-history -G # View zyp-dup detailed log
zypper-history -h # Help
zypper-history -v # VersionFlags are combinable: -i -d 2026-04-01, -r -l 7, etc.
COMMANDS (manual) - 2026-04-06
====================================================================================
Date/Time | Type | User | Command
====================================================================================
2026-04-06 09:12:31 | command | root | zypper dup
PACKAGES (install/removal) - 2026-04-06
====================================================================================
Date/Time | Action | Package | Version | Arch
====================================================================================
2026-04-06 09:13:05 | install | curl | 8.11.1-1.1 | x86_64
└─ Repository: repo-oss
2026-04-06 09:13:07 | remove | curl-old | 8.10.0-1.1 | x86_64
└─ Repository: repo-update
DÉPÔTS (add/remove) - 2026-04-06
====================================================================================
Date/Time | Action | Alias/URL
====================================================================================
2026-04-06 10:00:00 | radd | packman https://ftp.gwdg.de/pub/linux/misc/packman/...
/var/log/zypp/history records no explicit downgrade action — only install and remove. The -g flag detects candidates by finding packages that appear as both remove and install on the same day, then shows the version transition:
DOWNGRADES / RÉINSTALLATIONS DÉTECTÉS
(heuristique : paquet supprimé + réinstallé le même jour)
====================================================================================
2026-04-06
▼ kernel-default 6.12.14-1.1 → 6.12.13-1.1 [repo-oss]
For pre-execution downgrade detection, use zyp-dup (see below).
zypper dup modifies the system silently. Downgrades, vendor changes, and unexpected removals are listed in the output but gone as soon as the terminal closes. zyp-dup captures this information before anything is installed.
- Runs
LANG=C zypper --non-interactive dup --dry-run - Parses five sections: upgrades, new packages, downgrades, vendor changes, removals
- Displays a color-coded summary — critical changes highlighted in red/yellow with current version via
rpm -q - Logs the full pre-dup analysis to
/var/log/zypper-changes-detailed.logwith timestamp - Asks for confirmation before running the actual
zypper dup - Logs start and end timestamps of the real upgrade
zyp-dup # Run zypper dup with full pre-analysis
zyp-dup --no-recommends # Any zypper dup flag is passed through╔══════════════════════════════════════════════════════════════╗
║ zyp-dup — Analyse pré-mise à jour ║
╚══════════════════════════════════════════════════════════════╝
Résumé de la mise à jour :
══════════════════════════════════════════════════════════════
▶ Upgrades : 47
▶ Nouveaux : 2
▼ Downgrades : 1 ← ATTENTION
⇄ Chgt fournisseur : 0
✕ Suppressions : 0
══════════════════════════════════════════════════════════════
⚠️ Paquets qui vont être réduits (DOWNGRADE) :
▼ kernel-default (actuellement : 6.12.14-1.1)
Log sauvegardé dans : /var/log/zypper-changes-detailed.log
Lancer zypper dup ? [O/n]
zypper-history -G # View the log inside zypper-history (less -R)
cat /var/log/zypper-changes-detailed.log# zypper-history
sudo curl -o /usr/local/bin/zypper-history \
https://raw.githubusercontent.com/crisis1er/Zypper-Package-History-Logs/main/zypper-history
sudo chmod +x /usr/local/bin/zypper-history
# zyp-dup
sudo curl -o /usr/local/bin/zyp-dup \
https://raw.githubusercontent.com/crisis1er/Zypper-Package-History-Logs/main/zyp-dup
sudo chmod +x /usr/local/bin/zyp-dupOr clone:
git clone https://github.com/crisis1er/Zypper-Package-History-Logs.git
sudo cp Zypper-Package-History-Logs/zypper-history /usr/local/bin/
sudo cp Zypper-Package-History-Logs/zyp-dup /usr/local/bin/
sudo chmod +x /usr/local/bin/zypper-history /usr/local/bin/zyp-dup| Dependency | Purpose |
|---|---|
bash 5+ |
Script runtime |
zypper |
Repository listing and history source |
rpm |
Current version query (zyp-dup) |
awk |
Log parsing and formatting |
less |
Paginated terminal output |
Tested on openSUSE Tumbleweed.
| Color | Meaning |
|---|---|
| 🟢 Green bold | Package installed |
| 🔴 Red bold | Package removed / downgrade |
| 🟡 Yellow | Vendor change / important warning |
| 🔵 Blue | repo-oss — official openSUSE OSS |
| 🔷 Cyan | repo-update — official updates |
| 🟡 Yellow | packman — community multimedia |
| Dynamic | All other repositories — unique color assigned at runtime |
| ⚪ Grey | Unknown or unresolved repository |
This repository is developed as part of crisis1er/zsh-opensuse-tumbleweed, a set of tools and Oh My Zsh plugins for openSUSE Tumbleweed daily administration:
| Repository | Description |
|---|---|
| zsh-opensuse-tumbleweed | Hub — shared zsh config, HISTSIZE, themes |
| zsh-snap-new | Guided interactive Btrfs snapshot creation |
| zsh-snap-list | Colorized snapper listing with filters and menu |
| zsh-btrfs-snapper | Full Btrfs + snapper command set |
| Zypper-Package-History-Logs | Zypper audit + dup wrapper (this repo) |
Bug reports, suggestions, and pull requests are welcome.
- Open an issue for bugs or feature requests
- See CONTRIBUTING.md for development guidelines
Please include your openSUSE version, kernel version, and zypper version in bug reports.
Previous versions are available in the archive/ directory.
MIT License — see LICENSE for details.