elpkg is the SomaLinux package manager. It installs signed binary packages from
https://repo.somalinux.org/{arch} and can build packages from Bash recipes
for repo maintenance.
- Binary install/upgrade/remove with file ownership tracking.
- Dependency resolution (repo metadata driven).
- Package integrity via SHA256 and optional OpenSSL signatures.
- Snapshot/restore for rollback.
- Recipe-based builds to produce repo artifacts.
- SQLite-backed package state with
elpkg checkownership verification. - Per-file content hashes with
elpkg verifyand optional repair. - Global install/remove hooks with allow/deny policies.
- Optional script environment cleaning / non-root execution via config.
- Conflict handling with
--overwriteand upgrade/reinstall options. - Transaction journal with rollback and optional auto-snapshots.
- Dependency constraints and virtual provides/conflicts.
- Automatic refresh of installed Perl XS packages after Perl upgrades.
- Config:
/etc/elpkg/elpkg.conf(orelpkg/etc/elpkg.confin this repo). - DB:
/var/lib/elpkg/elpkg.sqliteby default, with snapshots and transactions under/var/lib/elpkg. - Cache:
/var/cache/elpkg(pkg_summary.gz, packages, sources, patch indexes).
elpkg sync
elpkg search bash
elpkg info bash
elpkg install bash
elpkg install --upgrade bash
elpkg install --reinstall bash
elpkg install --no-snapshot bash
elpkg remove bash
elpkg --jobs 8 build /path/to/recipe.sh
elpkg tx list
elpkg tx show <id>
elpkg tx rollback <id>
elpkg update
elpkg snapshot create baseline
elpkg snapshot restore baseline-<timestamp>
elpkg check
elpkg verify
elpkg verify --fix
The repository index is pkg_summary.gz, a gzip-compressed pkg_summary-style
text file with package name, version, release, arch, filename, size, SHA256,
dependency, provide, conflict, and description fields.
To build a repo index from locally built packages:
elpkg repo index /path/to/repo
If openssl_privkey is set in the config, this will also create
pkg_summary.gz.sig and per-package *.sig files in the repo directory.
To build a patches index (for repo/patches):
elpkg repo patches-index /path/to/repo/patches
To sync patches from the repo:
elpkg patches sync
Recipes live in elpkg/recipes/*.sh and follow a simple Bash format:
#!/bin/bash
set -euo pipefail
pkgname="example"
pkgver="1.2.3"
pkgrel=1
arch=("x86_64")
source=("https://example.org/example-${pkgver}.tar.gz")
sha256sums=("SKIP")
depends=("glibc")
provides=("libfoo")
conflicts=("oldfoo<2.0")
description="Example package"
build() {
cd "$srcdir/example-$pkgver"
./configure --prefix=/usr
make
}
package() {
cd "$srcdir/example-$pkgver"
make DESTDIR="$pkgdir" install
}
The build system sets:
srcdir/SRCDIR: unpacked source directorybuilddir/BUILDDIR: build working directorypkgdir/PKGDIR: staging root for packagingpatchdir/PATCHDIR: patches directory (from config if set)
- For signed repos, place trusted public key(s) at
/etc/elpkg/trusted.pem. Multiple keys can be comma-separated inopenssl_pubkeyfor rotation. verify_db = trueruns SQLitePRAGMA quick_checkbefore database reads.- Package archives store metadata in
meta/package.sqlite. - Set
require_file_hashes = trueto enforce hashes for all installed packages. - Hook scripts live in
/etc/elpkg/hooks.dand are executed by phase:/etc/elpkg/hooks.d/pre_install.d/*/etc/elpkg/hooks.d/post_install.d/*/etc/elpkg/hooks.d/pre_remove.d/*/etc/elpkg/hooks.d/post_remove.d/*- or named with a
phase-prefix in the base hooks dir. hooks_allowlist/hooks_denylistcontrol which scripts run.
- Transaction journals live under
/var/lib/elpkg/transactionsby default. - Transaction state is stored in
tx.sqlite; snapshots usesnapshot.sqlite. - Set
auto_snapshot = trueto create a snapshot before installs/removes. - Use
--no-snapshotto skip auto-snapshots for a single command. - Control transactions with
tx_enabled,tx_dir, andtx_keepinelpkg.conf. - Control parallel jobs with
make_jobsinelpkg.conf,ELPKG_MAKE_JOBS, or--jobs Non the CLI. This applies to recipe builds, install/upgrade/remove package scripts/hooks, and snapshot/transaction copy operations. - Config files under
/etcare treated specially: if modified, new versions are installed as.elpkg-newfiles instead of overwriting. elpkg verify --fixrepairs files only when the original package file is available.- Script hardening options:
script_env_clean,script_keep_env,script_user. - Source checksums can be set to
SKIPduring development.