29.7 Creating a Local Repository with createrepo
Right, so you’ve decided to become a package hoarder. I get it. Maybe you’ve got a fleet of air-gapped servers that can’t phone home to the mothership (the internet), or perhaps you’ve meticulously curated a set of packages that you don’t want yum or dnf second-guessing from some remote repo. Whatever your reason, creating a local repository is the way to go. And the tool for the job is createrepo_c (the modern, C-based successor to the old Python createrepo). It’s the thing that takes a directory full of .rpm files and makes them intelligible to your package manager. It does this by generating the all-important repodata directory, which is basically a set of XML files (primary, filelists, others) that act as a database cataloging every package in your directory—their dependencies, their files, everything. Without this, yum and dnf will look at your pile of RPMs and shrug. They need that metadata to do their job.