| name | epkg-usage |
| description | epkg package manager concepts, use cases, features, commands, environment management, package install/query/run |
epkg Package Manager Skill Document
This document helps AI Agents quickly understand and master the core concepts, use cases, and operations of the epkg package manager.
1. Core Concepts
1.1 What is epkg?
epkg is a lightweight, multi-source Linux package manager with key features:
- No root required: User-space installation, works for regular users
- Multi-distro support: Supports RPM, DEB, Alpine, Arch, Conda formats simultaneously
- Environment isolation: Each environment is independent, can mix packages from different distros
- Efficient storage: File-level deduplication, parallel downloads, content-addressed storage
- Sandbox execution: Supports namespace isolation and virtual machine isolation
1.2 Core Concept Model
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Host System โ
โ (Any Linux distro: openEuler, Debian, Fedora, Arch...) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ~/.epkg/envs/ โ
โ โโโ main/ โ Default environment (auto-created) โ
โ โ โโโ ebin/ โ Exposed binary entry points (PATH) โ
โ โ โโโ usr/ โ Software files (symlink โ store) โ
โ โ โโโ etc/ โ Configuration files โ
โ โโโ alpine/ โ Alpine environment (independent) โ
โ โโโ debian/ โ Debian environment (independent) โ
โ โโโ fedora/ โ Fedora environment (independent) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ~/.epkg/store/ โ Content-addressed storage (shared) โ
โ โโโ <hash>__<name>__<version>__<arch>/ โ
โ โโโ fs/ โ Extracted package files โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1.3 Key Terminology
| Term | Meaning |
|---|
| Environment | Independent software installation context with its own channel and installed package list |
| Channel | Software source configuration, e.g. debian, alpine, fedora, conda |
| Store | Content-addressed storage where all packages are extracted; environments reference via symlink |
| ebin | Environment's binary entry directory, added to PATH |
| Register | Persistently add environment's ebin to PATH |
| Activate | Temporarily activate an environment for current shell |
| Generation | Historical version of environment, supports rollback |
2. Use Cases
2.1 End User Scenarios
| Scenario | Traditional Pain Point | epkg Solution |
|---|
| Install extra software | Requires root, old system packages | No root needed, multiple distro sources available |
| Use newer software versions | System repos lag behind | Choose rolling-release sources like Fedora/Arch |
| Mix different distro software | Dependency conflicts, can't coexist | Multi-environment isolation, PATH combination |
| System rollback | Requires system-level snapshots | Each install records generation, one-click rollback |
2.2 Developer Scenarios
| Scenario | Traditional Pain Point | epkg Solution |
|---|
| Project dependency management | Pollutes system environment | Project directory .eenv isolated environment |
| Multi-language development | pip/npm global pollution | Per-environment independent toolchain |
| Cross-distro testing | Needs multiple machines or containers | One-click create Debian/Fedora/Alpine environments |
| CI/CD environments | Large images, slow builds | Static binary, deduplicated storage |
2.3 Container/Embedded Scenarios
| Scenario | Traditional Pain Point | epkg Solution |
|---|
| Image size | RPM/DEB metadata bloated | Slim storage, optional busybox applets |
| Base image | Must choose specific distro | Can mix multi-distro packages |
| Security isolation | Container escape risk | Supports VM-level sandbox |
3. Feature Overview
3.1 Command Groups Quick Reference
epkg <command>
โโ Self Management โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ self install Install epkg itself โ
โ self upgrade Upgrade epkg โ
โ self remove Remove epkg โ
โโ Package Operations โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ install Install packages โ
โ update Update repository metadata โ
โ upgrade Upgrade packages โ
โ remove Remove packages โ
โ list List packages โ
โ info Show package info โ
โ search Search packages โ
โโ Environment Management โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ env list List all environments โ
โ env create Create environment โ
โ env remove Remove environment โ
โ env register Register environment to PATH (persistent)โ
โ env unregister Unregister environment โ
โ env activate Activate environment (current shell) โ
โ env deactivate Deactivate environment โ
โ env path Show PATH โ
โ env config Environment configuration โ
โ env export Export environment config โ
โโ Execution & Sandbox โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ run Run command in environment โ
โ service Service management โ
โ busybox Built-in command implementations โ
โโ History & Rollback โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ history View environment history โ
โ restore Rollback to specified version โ
โ gc Garbage collection โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
3.2 Global Options
epkg [OPTIONS] <command>
Environment Selection:
-e, --env <NAME> Select environment by name
-r, --root <DIR> Select environment by path
--arch <ARCH> Specify architecture (x86_64, aarch64, riscv64)
Execution Control:
--dry-run Simulate run, don't modify system
--download-only Download only, don't install
-y, --assume-yes Auto-confirm
-q, --quiet Quiet mode
-v, --verbose Verbose output
Network:
--proxy <URL> HTTP proxy
--parallel-download N Parallel download threads
3.3 Supported Distributions (Channel)
| Format | Distributions |
|---|
| RPM | openEuler, Fedora, CentOS, AlmaLinux, Rocky, EPEL |
| DEB | Debian, Ubuntu, Linux Mint, Deepin |
| APK | Alpine (main, community) |
| Pacman | Arch Linux (core, extra, multilib, AUR) |
| Conda | conda-forge, main, free |
View complete list: epkg repo list
4. Typical Workflows
4.1 Quick Start Workflow
wget https://raw.atomgit.com/openeuler/epkg/raw/master/bin/epkg-installer.sh
bash epkg-installer.sh
bash
epkg env create myalpine -c alpine
epkg -e myalpine install bash htop
epkg -e myalpine run htop
epkg env register myalpine
htop --version
4.2 Multi-Environment Mixing
epkg env create debian-env -c debian
epkg env create fedora-env -c fedora
epkg env create alpine-env -c alpine
epkg -e debian-env install python3
epkg -e fedora-env install rustc
epkg -e alpine-env install nodejs
epkg env register alpine-env --path-order 10
epkg env register fedora-env --path-order 20
epkg env register debian-env --path-order 30
python3 --version
rustc --version
node --version
4.3 Project-Specific Environment
cd /path/to/myproject
epkg env create --root ./.eenv -c alpine
epkg --root ./.eenv install py3-pip py3-requests
echo ".eenv/" >> .gitignore
epkg run ./setup.sh
epkg run ./main.py
4.4 Rollback and History Management
epkg history
epkg restore 2
epkg restore -1
4.5 Isolate Modes
epkg -e myenv run bash
epkg -e myenv run --isolate=fs bash
epkg -e myenv run --isolate=vm bash
epkg -e myenv run --isolate=vm --vmm=libkrun,qemu bash
5. Common Commands Detail
5.1 Package Installation
epkg install package-name
epkg -e myenv install package-name
epkg install bash jq htop
epkg install ./package.rpm https://example.com/package.deb
epkg install --dry-run package
epkg install -y package
epkg install --no-install-recommends
5.2 Package Query
epkg list
epkg list bash*
epkg list --upgradable
epkg list --available
epkg search htop
epkg search --files ".desktop"
epkg info bash
epkg info bash --arch aarch64
5.3 Environment Management
epkg env list
epkg env create myenv -c alpine
epkg env create myenv -c debian:13
epkg env create --root /tmp/test/.eenv
epkg env register myenv --path-order 10
epkg env unregister myenv
epkg env activate myenv
epkg env deactivate
epkg env path
epkg env config get sandbox.isolate_mode
epkg env config set sandbox.isolate_mode fs
5.4 Running Commands
epkg -e myenv run command --args
epkg -e alpine run jq --version
epkg -e debian run python3 -c "print('hello')"
cd /project
epkg run ./script.sh
epkg busybox ls -la
epkg busybox cat /etc/passwd
epkg busybox sha256sum file.txt
6. Directory Structure and Files
6.1 User Private Installation Layout
~/.epkg/
โโโ envs/ # Environment directory
โ โโโ self/ # epkg self environment
โ โ โโโ usr/bin/epkg # epkg binary
โ โ โโโ usr/src/epkg/ # Source code and assets
โ โโโ main/ # Default environment
โ โ โโโ ebin/ # Exposed binaries (PATH)
โ โ โโโ usr/ # symlink โ store
โ โ โโโ etc/ # Configuration
โ โ โโโ generations/ # Historical versions
โ โโโ <env-name>/ # Other environments
โโโ store/ # Content-addressed storage
โ โโโ <hash>__<name>__<ver>__<arch>/fs/
โโโ config/ # Configuration files
โโโ options.yaml # Global options
โโโ envs/<env>.yaml # Environment config
~/.cache/epkg/
โโโ downloads/ # Download cache
โโโ channels/ # Repo metadata cache
โโโ aur_builds/ # AUR build cache
6.2 Root Shared Installation Layout
/opt/epkg/
โโโ cache/downloads/ # Shared download cache
โโโ cache/channels/ # Shared metadata cache
โโโ store/ # Shared storage
โโโ envs/
โโโ root/<env>/ # root user environments
โโโ <owner>/<env>/ # Other users' public environments
6.3 Key Configuration Files
| File | Purpose |
|---|
~/.epkg/config/options.yaml | Global options (default sandbox, proxy, etc.) |
~/.epkg/config/envs/<env>.yaml | Environment config (channel, public, etc.) |
<env_root>/etc/epkg/env.yaml | In-environment config |
~/.bashrc | Load epkg shell integration |
7. Advanced Features
7.1 Isolate Mode Comparison
| Mode | Isolation Level | Performance | Use Case |
|---|
env | namespace | Highest | Daily development |
fs | pivot_root | High | Need filesystem isolation |
vm | Virtual machine | Lower | Running untrusted code |
7.2 VMM Backends
| Backend | Features |
|---|
libkrun | Lightweight microVM, fast startup |
qemu | Full VM, broad compatibility |
7.3 Built-in Busybox Commands
epkg busybox --list
epkg busybox ls
epkg busybox cat
epkg busybox grep
epkg busybox sed
epkg busybox wget
epkg busybox tar
epkg busybox sha256sum
8. Troubleshooting
8.1 Common Issues
| Issue | Solution |
|---|
command not found | Confirm environment is registered: epkg env list |
| Download failed | Check network/proxy: --proxy |
| Permission error | Confirm running in user namespace |
| Dependency conflict | Check --dry-run output |
8.2 Debug Options
epkg -v install package
RUST_LOG=debug epkg install package
epkg --dry-run install package
8.3 Cleanup and Recovery
epkg gc
epkg gc --old-downloads 7
epkg history
epkg restore <gen_id>
9. Best Practices
9.1 Environment Naming Convention
main # Default environment
dev-<project> # Project development environment
<distro> # Distro test environment (debian, fedora)
<tool> # Tool environment (rust, python, node)
9.2 PATH Priority Strategy
epkg env register dev-tools --path-order 5
epkg env register compat --path-order 50
epkg env register fallback --path-order -10
9.3 Project Workflow
project/
โโโ .eenv/ # epkg environment (add to .gitignore)
โโโ .gitignore
โโโ README.md # Doc: "Run epkg run ./setup.sh"
โโโ src/
10. Comparison with Similar Tools
| Feature | epkg | Nix | Conda | Docker |
|---|
| No root | โ
| โ
| โ
| โ |
| Multi-distro | โ
| Partial | โ | โ
|
| Mix packages | โ
| โ
| โ | โ |
| Native performance | โ
| โ
| โ
| Overhead |
| Learning curve | Low | High | Low | Medium |
Appendix: Command Cheat Sheet
wget ... && bash epkg-installer.sh && bash
epkg env list
epkg env create <name> -c <channel>
epkg env remove <name>
epkg env register <name>
epkg env activate <name>
epkg install <pkg>
epkg remove <pkg>
epkg update
epkg upgrade
epkg list
epkg search <pattern>
epkg info <pkg>
epkg -e <env> run <cmd>
epkg run ./script.sh
epkg history
epkg restore <gen>
epkg gc
epkg repo list
epkg --version
Document Version: v1.0
Applicable to: epkg 0.2.4+