Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
A repository is just a folder with .rpm files and a repodata/ folder with the index. createrepo DIR (on RHEL the fast C version createrepo_c) reads all packages and writes the index. Then point a .repo file to the folder (baseurl=file:///DIR) or share it with a web server.
After you add or remove packages, run it again with --update (faster).
Zo schrijf je het
createrepo [OPTION]... DIRECTORYOpties 21
Meest gebruikt
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1Install the tool
dnf install -y createrepo_cGives the
createrepoandcreaterepo_ccommands.2Make a repository of a folder
createrepo /srv/myrepoCreates /srv/myrepo/repodata/.
3Use it on this machine
cat /etc/yum.repos.d/myrepo.repo [myrepo] name=My packages baseurl=file:///srv/myrepo gpgcheck=0Then
dnf repolistshows it.4Update after adding packages
cp new-tool-2.0-1.el10.x86_64.rpm /srv/myrepo/; createrepo --update /srv/myrepoFaster than a full run.
5Share the repository over HTTP
Clients use
baseurl=http://server1/myrepo(check SELinux labels: restorecon or semanage fcontext).6Build an offline mirror of needed packages
dnf download --resolve --destdir=/srv/myrepo ansible-core createrepo /srv/myrepoFor servers without internet.
7Add package groups
createrepo -g comps.xml /srv/myrepoThen
dnf group listshows your groups.8Leave out test packages
createrepo -x '*-debuginfo-*' /srv/myrepoSmaller index.
9Sign your packages (security)
rpm --addsign /srv/myrepo/*.rpmNeeds a GPG key in ~/.rpmmacros; then clients can use gpgcheck=1.
10Clean the dnf cache after changes
Clients see the new packages.
Niets past bij dit filter.
Exitcodes
0 :: Done. 1 :: Error.