PKG_REPOS(3)
π NAME π
ok so <pink>pkg_repos</pink> and her whole friend group β pkg_repos_total_count, pkg_repos_activated_count, pkg_repo_url, pkg_repo_ident, pkg_repo_name, pkg_repo_ident_from_name, pkg_repo_key, pkg_repo_fingerprints, pkg_repo_signature_type, pkg_repo_mirror_type, pkg_repo_enabled, pkg_repo_priority, pkg_repo_find_ident, pkg_repo_find_name π β all of them manipulate repositories. that's the whole vibe, bestie.
this is section 3 of the manual, PKG_REPOS(3), from the Library Functions Manual β¨
π LIBRARY π
it lives in the library libpkg. iconic of her honestly π«Ά
β¨ SYNOPSIS β¨
okay here's the whole cast list, no cap:
#include <pkg.h>
int
pkg_repos(struct pkg_repo **r);
int
pkg_repos_total_count(void);
int
pkg_repos_activated_count(void);
const char *
pkg_repos_url(struct pkg_repo *);
const char *
pkg_repo_ident(struct pkg_repo *);
const char *
pkg_repo_name(struct pkg_repo *);
const char *
pkg_repo_ident_from_name(const char *);
const char *
pkg_repo_key(struct pkg_repo *);
const char *
pkg_repo_fingerprints(struct pkg_repo *);
signature_t
pkg_repo_signature_type(struct pkg_repo *);
bool
pkg_repo_enabled(struct pkg_repo *);
unsigned int
pkg_repo_priority(struct pkg_repo *);
mirror_t
pkg_repo_mirror_type(struct pkg_repo *);
struct pkg_repo *
pkg_repo_find_ident(const char *ident);;
struct pkg_repo *
pkg_repo_find_name(const char *name);;
π not me pointing out that the synopsis sayspkg_repos_urlbut DESCRIPTION sayspkg_repo_urlβ and the last two have a lil double;;situation. i'm literally just the messenger, copy them exactly as they are, mwah π
π DESCRIPTION π
pkg_repos() β okay so she takes the address of a pointer to the repository. lowkey important: the pointer should be initialised to NULL before you pass it to her. on each iteration the pointer will point to the new repository π¦. she returns EPKG_FATAL if an error happened, otherwise she returns EPKG_OK until the very last repository is found, and in that case EPKG_END comes back. so like, you loop until you get EPKG_END, iykyk π
pkg_repos_total_count() β returns the total number of defined repositories. all of them. the whole roster π₯
pkg_repos_activated_count() β returns the total number of "enabled" repositories. only the ones who showed up π
pkg_repo_url() β takes a pointer to a repository as argument and gives you the "url" defined for that repository. slay.
pkg_repo_ident() β takes a pointer to a repository as argument and returns the internal identification string of the repository. her legal name, basically π
pkg_repo_name() β takes a pointer to a repository as argument and returns the "name" of the repository. her nickname π
pkg_repo_key() β takes a pointer to a repository as argument and returns the path to the public key π. but listen β if the repository is not signed by a public key, NULL gets returned. it's giving "no key, no entry" π
pkg_repo_fingerprints() β takes a pointer to a repository as argument and returns the path to the fingerprints. and same deal: if the repository is not signed using the "FINGERPRINT" method, NULL will be returned. read the room π«Ά
pkg_repo_signature_type() β takes a pointer to a repository as argument and returns the type of signature it uses. the options are:
SIG_NONEβ the repository is not signed πSIG_PUBKEYβ the repository is signed using thePUBKEYmethod βSIG_FINGERPRINTβ the repository is signed using theFINGERPRINTmethod πΈ
pkg_repo_enabled() β takes a pointer to a repository as argument and returns true if the repository is "enabled". otherwise she returns false. simple as π
pkg_repo_priority() β takes a pointer to a repository as argument and returns the priority of the repository as an unsigned integer. and this part matters fr fr: packages are chosen preferentially from the repository with the highest priority value and which has that package available. so the high-priority repo is the main character here ππ₯
pkg_repo_mirror_type() β takes a pointer to a repository as argument and returns the type of mirroring it uses. the flavours:
SRVβ the repository is using an SRV record query to get the mirrors π§HTTPβ the repository is using the HTTP query method to get the mirrors πNOMIRRORβ the repository does not have any mirror π
pkg_repo_find_ident() β takes an internal identification string as argument and returns a pointer to a repository. if no repository matches, NULL is returned. no match, no vibes π
pkg_repo_find_name() β takes a repository "name" as argument and returns a pointer to a repository. and again: if no repository matches, NULL is returned. same energy, different search bar π
and that's the whole page bestie, go loop over some repos responsibly π¦β¨
this page is from Debian, dated December 12, 2025, and it's PKG_REPOS(3) β mwah, love u, bye π
π¦ 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