A simple, source-based package manager written in C, designed for LFS systems. It handles the full lifecycle of a package: build, install, track, and remove.
- Install packages from source tarballs using custom build scripts
- Tracks every file installed by a package
- Clean removal — deletes all owned files and prunes empty directories
- Package metadata database at
/var/lib/lpkg/ - Query commands:
list,info,files,search - Man page included
make
sudo make install # installs to /usr/local/bin by default
sudo make install PREFIX=/usr # or wherever you preferDebug build:
make DEBUG=1sudo lpkg install curl 8.7.1 curl-8.7.1.tar.gz scripts/autotools.sh "HTTP client"The build script runs inside the extracted source tree with bash.
Three ready-made templates are in scripts/:
| Script | Build system |
|---|---|
scripts/autotools.sh |
./configure && make |
scripts/cmake.sh |
CMake |
scripts/meson.sh |
Meson + Ninja |
sudo lpkg remove curlAsks for confirmation, then deletes every tracked file.
lpkg listlpkg info curllpkg files curllpkg search http/var/lib/lpkg/
└── curl/
├── info ← name, version, description, installed date
└── files ← one absolute file path per line
Before extracting the tarball, lpkg creates a timestamp file. After the
build script completes, it runs:
find / -newer <stamp> -not -path '/proc/*' ... -type fEvery file newer than the stamp is recorded as owned by the package. This works well for sequential LFS builds where you're the only one writing to the system during installation.
- Must be run as root for packages that install into system directories.
- No dependency resolution — consistent with the LFS philosophy of manual, ordered builds.
- The
removecommand will skip files that are already missing (e.g. if you deleted them manually) and warn about files it couldn't remove.