Universal Package Inspector (UPI) is an in-progress command-line tool designed to scan and analyze installed packages across multiple package managers on a Linux system. UPI aims to detect potential conflicts, such as duplicate packages, version mismatches, or file path overlaps, and generate detailed reports in various formats, such as text, JSON, or HTML.
The tool currently supports the following package managers:
dpkg
(Debian-based systems)rpm
(Red Hat-based systems)dnf
flatpak
snap
pip
(Python packages)
-
Multi-Package Manager Support: Simultaneously scans for packages installed by different package managers and analyzes potential conflicts between them.
-
Conflict Detection: Identifies several types of conflicts:
- Version Conflicts: Detects different versions of the same package installed via different managers.
- Manager Conflicts: Flags situations where multiple managers have installed the same package.
- File Path Conflicts (planned): Detects if different packages install files to the same locations.
-
Report Generation: Outputs conflict reports in multiple formats:
- Text
- JSON
- HTML
This project is currently in progress and has been tested on Fedora. The core functionality for package scanning, conflict detection, and basic report generation is implemented. Further enhancements and additional features are planned.
- C++17 or higher
- CMake (for building the project)
- nlohmann/json (for JSON report generation)
To build the UPI CLI tool from source:
-
Clone the repository:
git clone <repository-url> cd unified-package-inspector
-
Create a build directory and compile the project:
mkdir build cd build cmake .. make
-
Run the CLI tool:
./upi_cli
UPI is used through its CLI, allowing you to scan for package conflicts and generate reports.
./upi_cli scan --output-format <format>
scan
: Scans the system for installed packages and detects conflicts.--output-format <format>
: Specifies the output format for the report. Options includetext
,json
, andhtml
.
Generate a conflict report in JSON format:
./upi_cli scan --output-format json
Currently, UPI automatically detects available package managers and scans for packages installed by them. The tool includes related manager pairs, like dnf
and rpm
, to avoid false positives for packages that are inherently linked unless there is a version mismatch.
To extend the tool to support additional related package managers, modify the relatedManagers
map in the conflict_analyzer.cpp
file.
cli.cpp
: Implements the command-line interface, handling user input and orchestrating the scanning and reporting process.conflict_analyzer.cpp
: Contains the logic to detect conflicts between packages, such as version mismatches or duplicate installations by different managers.report_generator.cpp
: Generates conflict reports in text, JSON, or HTML formats based on the detected issues.- Package Manager Adapters: Each supported package manager has a dedicated adapter:
dpkg_adapter.cpp
rpm_adapter.cpp
dnf_adapter.cpp
flatpak_adapter.cpp
snap_adapter.cpp
pip_adapter.cpp
Contributions to UPI are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
feature/your-feature
). - Commit your changes (
git commit -m 'Add your feature'
). - Push to the branch (
git push origin feature/your-feature
). - Create a Pull Request.
* libgtest-dev for apt / gtest-devel for fedora
* ./build/upi scan text
* [x] detect available package managers
* [x] implement filesystem scanner
* [x] implement a conflict search for available package managers
* [x] create a suitable report generator
* [ ] look what package managers may in real have conflicts and what type of conflicts
* [ ] create a test docker container with included conflicts for e2e tests
* [ ] include package managers: ...
This project is licensed under the MIT License. See the LICENSE
file for more details.
For support or any inquiries, please contact [email protected]
.