PKG_REPO_CREATE(3)
π PKG_REPO_CREATE(3) β the libpkg glow-up where you literally build a whole repo π
okay bestie, so this page lives in the Library Functions Manual, and it's all about the libpkg crew that spins up a package repository from scratch. it's giving "let me just manifest a repo real quick" β¨
πΈ NAME πΈ
pkg_repo_create, pkg_repo_create_new, pkg_repo_create_free, pkg_repo_create_set_output_dir, pkg_repo_create_set_create_filelist, pkg_repo_create_set_hash, pkg_repo_create_set_hash_symlink, pkg_repo_create_set_metafile, pkg_repo_create_set_sign β create repository of packages π
no cap, that's the whole squad. every single one of them is on this page and we're covering all of them, don't worry π
π LIBRARY π
library βlibpkgβ β yep, that's where all these icons live π«Ά
β¨ SYNOPSIS β¨
#include <pkg.h>
struct pkg_repo_create *
pkg_repo_create_new();
void
pkg_repo_create_free(struct pkg_repo_create *);
bool
pkg_repo_create_set_output_dir(struct pkg_repo_create *, const char *);
void
pkg_repo_create_set_create_filelist(struct pkg_repo_create *, bool);
void
pkg_repo_create_set_hash(struct pkg_repo_create *, bool);
void
pkg_repo_create_set_hash_symlink(struct pkg_repo_create *, bool);
void
pkg_repo_create_set_metafile(struct pkg_repo_create *, const char *);
void
pkg_repo_create_set_sign(struct pkg_repo_create *, char **, int,
pkg_password *);
int
pkg_repo_create(struct pkg_repo_create *, char *);
look at that signature lineup π it's like a whole friend group walking in slow-mo. bool, void, int β everyone showed up π
π DESCRIPTION π
okay so here's the tea on every single one of these functions, in order, no skips π
pkg_repo_create_new()β Allocates a newstruct pkg_repo_create *which should be freed by the caller usingpkg_repo_create_free(). so like, you birth this struct into existence and then you are responsible for its cleanup. main character energy comes with main character responsibilities, periodt πpkg_repo_create_set_output_dir()β defines the output directory to save the data in. By default it will be the path provided to thepkg_repo_create()function. lowkey convenient, it just reuses the path you already gave it πpkg_repo_create_set_create_filelist()β Accept a boolean to define if the file database should be created along with the metadata database (deprecated). Defaults tofalse. ngl bestie, this one is deprecated, so maybe don't get too attached π it's giving retired icon.pkg_repo_create_set_hash()β When creating the repository, move all the packages found into a"Hashed"subdirectory with the"hash"of the package appended to the name of the package. Defaults tofalse. that's the whole hash-girl aesthetic β everything gets filed away with its little hash label on it πpkg_repo_create_set_hash_symlink()β If the hash functionality has been activated, then there will be a symlink for each packages in the"Hashed"directory will be created in the root of the repository. Defaults tofalse. yes β symlinks in the root so nobody has to dig through the"Hashed"folder like it's a group chat with 400 unread messages π₯
β οΈ heads up bestie: this one only does its thing if the hash functionality has been activated. no hash, no symlinks β it's a package deal fr fr π
pkg_repo_create_set_metafile()β Define the path to the metafile that will be used when creating the repository. If none is specified that it will fallback on the internal default. so you can pick your own metafile or just vibe with the built-in one β¨pkg_repo_create_set_sign()β Define the signing mechanism, which will be used to sign the metadata of the repository. Defaults to none. signing the metadata = giving it that verified crown π because unsigned metadata is giving "who even are you" π§pkg_repo_create()β Create a repository out of the packages found in the provided path. this is THE moment, the finale, the slay of the century π it takes all those packages and turns them into an actual repo. ate and left no crumbs π
π¦ SEE ALSO π¦
hmm nothing listed here, bestie β this page keeps its circle small π
quick recap: callpkg_repo_create_new()first, configure your vibe with thepkg_repo_create_set_*functions, runpkg_repo_create(), thenpkg_repo_create_free()when you're done. iykyk π«Ά
Debian π December 12, 2025 β that's the version and date, bestie, straight from the source. this page ate and it's not coming back π β¨πΈπ¦
π¦ where this page comes from
- nixos 26.05: pkg 2.7.5
- nixpkgs unstable: pkg 2.7.5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms