clib¶
- ID
clib- Home page
- Platforms
🐧 Linux · 🍎 macOS
- Operations
search·install·remove- purl types
pkg:clib- CLI name
clib- Issues and PRs
- Source
clib is the package manager of the C ecosystem, distributing small libraries and standalone programs.
Parsing notes, verified against clib 2.8.7 on macOS:
installforces--global. Without it clib vendors sources into adeps/directory relative to the working directory, which is a project operation rather than a machine-wide one;--globalinstalls to the prefix instead.No inventory: clib ships no
listcommand of any kind, soinstalledandoutdatedare not declared and mpm auto-skips them. What remains is still more than the competing wrappers offer, none of which reach clib at all.upgradeis not declared either.clib upgradeupgrades clib itself to a given version rather than any package, andclib updatere-fetches packages into the projectdeps/directory, so neither is a package upgrade.Every operation keys on the
owner/reposlug.searchreports it asrepo,installtakes it directly, anduninstallparses it back apart throughparse_repo_owner/parse_repo_name(src/clib-uninstall.c), so one id feeds all three.The registry carries no versions at all, only names, URLs and descriptions, so search results are yielded version-less. The description is dropped too: the definition schema only maps
package_id,installed_versionandlatest_version, so a class would be needed to carry it, which is not worth the weight for one cosmetic column.
What mpm adds to clib¶
Through mpm, clib gains --exact and --extended search, to narrow to exact names or match descriptions.
Bigger still, mpm reaches across every manager at once: mpm installed and mpm outdated cover clib alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.
Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.
Your clib commands, in mpm¶
You already know clib: each operation maps one-to-one onto mpm, in an interface shared by every manager.
To… |
With |
With |
|---|---|---|
Search for a package |
|
|
Install a package |
|
|
Remove a package |
|
|
Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.
Operations¶
Operation |
Supported |
Notes |
|---|---|---|
|
||
|
||
|
||
|
✓ |
exact and extended search backfilled by |
|
✓ |
|
|
||
|
||
|
✓ |
|
|
||
|
||
|
Selecting and configuring clib¶
Deselect clib for a single run with --no-clib, or persist the choice in your configuration:
[mpm]
clib = false
Keep it enabled but tune how mpm drives it with a per-manager override:
[mpm.managers.clib]
timeout = 900
mpm config-template clib prints every overridable attribute as a ready-to-paste block.
Recipes¶
A few jobs you would otherwise script around clib, one mpm command each:
Snapshot and clone a machine:
mpm --clib dump clib.toml, thenmpm restore clib.tomlon the next one.Export a compliance SBOM:
mpm --clib sbom(CycloneDX by default,--spdxfor SPDX).
Privilege escalation¶
mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.
None of its operations needs root.
See privilege escalation for the full policy.
Cooldown¶
State of clib’s release-age gating, from the cooldown support table:
Status: ❌ None
A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:
Registry: clib package wiki
Retraction: Wiki edit: the index is a GitHub wiki page, clibs/clib/wiki/Packages, scraped as HTML (
CLIB_WIKI_URLinsrc/clib-search.c), so withdrawal is an edit to that page; the code itself is fetched from the GitHub archive of whichever repository the row names, and disappears with itPublish date: ❌ the index carries names, URLs and descriptions only, with no version field at all, so there is nothing to date a release by
With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.
Version probe¶
The version is probed by running:
$ clib --version
2.8.7
and extracted with:
r"(?P<version>\d+\.\d+\.\d+)"
Reference traces¶
Raw native outputs captured in the bundled definition: the reference mpm’s parsers were written against. If you know clib well and a transcript below looks wrong, or a newer release changed its output format, report it.
$ clib search --json --no-color {query}
[
{
"repo": "willemt/skiplist",
"href": "https://github.com/willemt/skiplist",
"description": "Dictionary implemented through a skiplist",
"category": "data structure"
}
]
Feed any of these through mpm and the raw output becomes one uniform table, the same shape for every manager: filter it, project columns, or export it (mpm --clib installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.
Changelog¶
7.7.0.dev0(unreleased)Add clib package manager as a bundled definition, with
search,installandremovesupport.installforces--global, without which clib vendors sources into adeps/directory relative to the working directory. It ships no listing command, so no inventory is declared.