PKG_REPOS(3)

πŸ“¦ version 2.7.5, in nixos 26.05, nixpkgs unstable

πŸŽ€ 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 says pkg_repos_url but DESCRIPTION says pkg_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 the PUBKEY method ⭐
  • SIG_FINGERPRINT β€” the repository is signed using the FINGERPRINT method 🌸

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