42da0fb84f5cbf28212f705b0740f796b1f48c9f
PM - Package Manager for Simple Linux
A lightweight, shell-based package manager designed for simple Linux systems. PM provides essential package management functionality with minimal dependencies and a straightforward command-line interface.
Features
- Lightweight: Written in pure shell script with minimal dependencies
- Simple: Easy-to-use command-line interface
- Flexible: Supports local and remote package installation
- Portable: Works on any POSIX-compliant system
- Efficient: Fast package operations with local caching
Installation
From Source
- Clone or download the repository
- Run the installation command:
sudo make install
Manual Installation
Copy the src/pm script to /usr/bin/pm and ensure it's executable:
sudo cp src/pm /usr/bin/pm
sudo chmod +x /usr/bin/pm
Usage
Basic Commands
# Install a package
pm add package-name
# Download package without installing
pm down package-name
# Install from local package file
pm unpack /path/to/package.pkg.gz
# Remove a package
pm del package-name
# List files in a package
pm list package-name
# Search for packages
pm search package-name
# Show installed packages
pm query
# Show help
pm help
Examples
# Install pfetch package
pm add pfetch
# Download busybox without installing
pm down busybox
# Install from local package
pm unpack ./custom-package.pkg.gz
# Remove pfetch
pm del pfetch
# List all files in busybox package
pm list busybox
# Search for packages containing "fetch"
pm search fetch
Directory Structure
PM uses the following directory structure:
/
├── etc
│ └── pm
│ └── repo # Repository configuration
├── tmp # Temporary files
├── usr
│ ├── bin
│ │ └── pm # Main PM executable
│ └── share
│ └── pm
│ ├── packages # Package metadata
│ ├── query # Query cache
│ └── repos # Repository data
│ └── localhost
│ └── query
└── var
└── cache
└── pm
└── pkg # Cached package files
Package Format
PM packages use a simple archive format with the following structure:
package-name.pkg.gz
├── list # List of files in package
├── deps # Package dependencies
├── post_install # Post-installation script (optional)
└── usr/ # Package files
└── bin/
└── executable
Package Files
- list: Contains a list of all files included in the package
- deps: Lists package dependencies (one per line)
- post_install: Optional script executed after installation
- Package files: The actual files to be installed
Example Package Structure (pfetch)
pfetch.pkg.gz
├── list
├── deps
├── post_install
└── usr
└── bin
└── pfetch
list file:
usr/bin/pfetch
deps file:
busybox
Creating Packages
To create a package for PM:
- Create a directory with your package name
- Add your files in the appropriate directory structure
- Create a
listfile with all file paths - Create a
depsfile with dependencies - Optionally add a
post_installscript - Archive with gzip:
tar -czf package.pkg.gz package-dir/
Building
Build Package
make package
Clean Build Files
make clean
Uninstall
sudo make uninstall
Requirements
- POSIX-compliant shell (bash, dash, etc.)
- Basic Unix utilities (tar, gzip, etc.)
- Root privileges for installation/removal
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Tola Mironcenko
Version
Current version: 1.0.0
PM is designed to be simple, efficient, and reliable. For bug reports or feature requests, please open an issue in the project repository.