145 lines
2.9 KiB
Markdown
145 lines
2.9 KiB
Markdown
|
# Universal Package Manager (UPM)
|
||
|
|
||
|
A unified command-line interface for managing packages across different Linux distributions. UPM provides a consistent interface for package management operations regardless of the underlying package manager (apt, dnf, pacman, etc.).
|
||
|
|
||
|
## Features
|
||
|
|
||
|
- 🔄 Universal syntax across package managers
|
||
|
- 📦 Support for multiple package managers:
|
||
|
- apt (Debian/Ubuntu)
|
||
|
- dnf/yum (RHEL/Fedora)
|
||
|
- pacman (Arch)
|
||
|
- zypper (openSUSE)
|
||
|
- apk (Alpine)
|
||
|
- xbps (Void Linux)
|
||
|
- emerge (Gentoo)
|
||
|
- 🚀 Support for universal package managers:
|
||
|
- snap
|
||
|
- flatpak
|
||
|
- 🔍 Version-specific package installation
|
||
|
- 📋 Repository management
|
||
|
- 🧹 Cache cleaning
|
||
|
- 🔗 Dependency handling
|
||
|
|
||
|
## Installation
|
||
|
|
||
|
### Prerequisites
|
||
|
|
||
|
- Go 1.22 or newer
|
||
|
- Git
|
||
|
|
||
|
### Building from Source
|
||
|
|
||
|
1. Clone the repository and enter the directory:
|
||
|
|
||
|
git clone https://git.supernets.org/e/managerofmanagers
|
||
|
cd upm
|
||
|
|
||
|
2. Install dependencies:
|
||
|
|
||
|
go mod download
|
||
|
|
||
|
3. Build the binary:
|
||
|
|
||
|
go build -o upm
|
||
|
|
||
|
4. (Optional) Install system-wide:
|
||
|
|
||
|
sudo mv upm /usr/local/bin/
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
### Basic Commands
|
||
|
|
||
|
Install packages:
|
||
|
upm install nginx
|
||
|
upm install nginx@1.18.0 # Install specific version
|
||
|
|
||
|
Remove packages:
|
||
|
upm remove nginx
|
||
|
|
||
|
Search for packages:
|
||
|
upm search nginx
|
||
|
|
||
|
Update package lists:
|
||
|
upm update
|
||
|
|
||
|
Upgrade installed packages:
|
||
|
upm upgrade
|
||
|
|
||
|
List installed packages:
|
||
|
upm list
|
||
|
|
||
|
Show package information:
|
||
|
upm info nginx
|
||
|
|
||
|
### Repository Management
|
||
|
|
||
|
Add a repository:
|
||
|
upm repo add https://repo.example.com
|
||
|
|
||
|
Remove a repository:
|
||
|
upm repo remove example-repo
|
||
|
|
||
|
List repositories:
|
||
|
upm repo list
|
||
|
|
||
|
### Maintenance
|
||
|
|
||
|
Clean package cache:
|
||
|
upm clean
|
||
|
|
||
|
Remove unused dependencies:
|
||
|
upm autoremove
|
||
|
|
||
|
### Dependency Management
|
||
|
|
||
|
Check dependencies:
|
||
|
upm check-deps
|
||
|
|
||
|
Check dependencies for specific package:
|
||
|
upm check-deps nginx
|
||
|
|
||
|
Show package dependencies:
|
||
|
upm show-deps nginx
|
||
|
|
||
|
### Using Universal Package Managers
|
||
|
|
||
|
Install using snap:
|
||
|
upm -u snap install firefox
|
||
|
|
||
|
Install using flatpak:
|
||
|
upm -u flatpak install org.mozilla.firefox
|
||
|
|
||
|
## Project Structure
|
||
|
|
||
|
upm/
|
||
|
├── main.go # Main application entry point
|
||
|
├── pkg_manager/
|
||
|
│ └── pkg_manager.go # Core package manager implementation
|
||
|
├── go.mod
|
||
|
├── go.sum
|
||
|
└── README.md
|
||
|
|
||
|
## Dependencies
|
||
|
|
||
|
Required Go packages:
|
||
|
- github.com/fatih/color - For colorized terminal output
|
||
|
- github.com/briandowns/spinner - For progress indicators
|
||
|
|
||
|
## Contributing
|
||
|
|
||
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
||
|
|
||
|
## License
|
||
|
|
||
|
This project is licensed under the MIT License - see the LICENSE file for details.
|
||
|
|
||
|
## Acknowledgments
|
||
|
|
||
|
- Thanks to all the Linux distribution maintainers for their package managers
|
||
|
- The Go community for the excellent standard library and third-party packages
|
||
|
|
||
|
## Support
|
||
|
|
||
|
If you encounter any issues or have questions, please file an issue on the GitHub repository.
|