# Fix No available modular metadata package offline repo

**URL:** <https://forums.rockylinux.org/t/fix-no-available-modular-metadata-package-offline-repo/8713>\
**Category:** Infrastructure\
**Created:** [January 28, 2023, 2:42pm UTC](https://forums.rockylinux.org/t/fix-no-available-modular-metadata-package-offline-repo/8713 "2023-01-28T14:42:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsexton18](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@dsexton18](https://forums.rockylinux.org/u/dsexton18)\
**Post date:** [January 28, 2023, 2:42pm UTC](https://forums.rockylinux.org/t/fix-no-available-modular-metadata-package-offline-repo/8713/1 "2023-01-28T14:42:32Z")

</div>

I have an offline repo however it’s missing modular metadata. I ran createrepo to try and repair the repo. However I can still see the metadat is missing. How can I fix this?

---

<div class="post-metadata">

**Author:** ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)\
**Post date:** [January 28, 2023, 5:01pm UTC](https://forums.rockylinux.org/t/fix-no-available-modular-metadata-package-offline-repo/8713/2 "2023-01-28T17:01:32Z")

</div>

Running createrepo will destroy modular data in a repository. It’s easier to redo the reposync to get the repo data back.

```auto
# rocky 8
dnf reposync -g --delete -p /path/to/baseos --download-metadata --repoid=baseos
dnf reposync -g --delete -p /path/to/appstream --download-metadata --repoid=appstream
dnf reposync -g --delete -p /path/to/powertools --download-metadata --repoid=powertools
dnf reposync -g --delete -p /path/to/extras --download-metadata --repoid=extras
# rocky 9
dnf reposync -g --delete -p /path/to/baseos --download-metadata --repoid=baseos
dnf reposync -g --delete -p /path/to/appstream --download-metadata --repoid=appstream
dnf reposync -g --delete -p /path/to/powertools --download-metadata --repoid=crb
dnf reposync -g --delete -p /path/to/extras --download-metadata --repoid=extras

```

---

<div class="post-metadata">

**Author:** ![mstauber](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/mstauber/32/8_2.png) [@mstauber](https://forums.rockylinux.org/u/mstauber)\
**Post date:** [January 29, 2023, 7:06am UTC](https://forums.rockylinux.org/t/fix-no-available-modular-metadata-package-offline-repo/8713/3 "2023-01-29T07:06:58Z")

</div>

What @label said is without doubt the best answer for a local repo mirror.

OTOH: There are scenarios where you can use “createrepo\_c” with the --update flag. Provided you have a comps.xml for the repo in question.

Likewise “modifyrepo\_c” can be called with --mdtype=modules by pointing it to your modules.yaml.

We do custom rebuilds of EL8 and EL9 ISO images and replace or drop in around 1200 RPMs in our special builds, which forces us to update the local repository on the ISO as well. A traditional createrepo call would trash the module data, so we use this work around:

```auto
createrepo_c --update -g /home/build_cd/ISO/Minimal/comps.xml /home/build_cd/ISO/Minimal
modifyrepo_c --mdtype=modules /home/build_cd/ISO/Minimal/modules.yaml /home/build_cd/ISO/Minimal/

```

Like said: This depends on having a comps.xml and modules.yaml that match your repository layout and that might not be a given in your situation.

---

<div class="post-metadata">

**Author:** ![dsexton18](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@dsexton18](https://forums.rockylinux.org/u/dsexton18)\
**Post date:** [January 30, 2023, 4:29pm UTC](https://forums.rockylinux.org/t/fix-no-available-modular-metadata-package-offline-repo/8713/4 "2023-01-30T16:29:25Z")

</div>

Thank for the response. Is possible to build the repo from the DVD ISO? Than run the reposync after that? I built a repo using the DVD. Installed python2 to ensure the required metadate was there. Ran reposync from an existing repo that is missing the modules metadata but looks like the metadat is erased after the reposync completes . Which puts me back ot your solution.

---

<div class="post-metadata">

**Author:** ![mstauber](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/mstauber/32/8_2.png) [@mstauber](https://forums.rockylinux.org/u/mstauber)\
**Post date:** [January 31, 2023, 3:52pm UTC](https://forums.rockylinux.org/t/fix-no-available-modular-metadata-package-offline-repo/8713/5 "2023-01-31T15:52:10Z")

</div>

> Is possible to build the repo from the DVD ISO?

Depends on what you want to achieve. Do you want a local mirror that is in sync with one of the official mirrors? In that case this wouldn’t be the best of ideas and I’d rather recommend reposync or (if supported by the mirror) rsync.

If you just need a one-shot local mirror that has the DVD RPMs and doesn’t get updates from an official mirror? Then my suggested method should work.

If you want a local copy of the official mirror _and_ want a repository with your own RPMs that aren’t available upstream? In that case the easiest approach is to split this in two:

1.) Create a local copy of the official mirror using “reposync”.

2.) Stuff your own RPMs into a second and separate local repository and create the meta-data for it. If your local and custom repo doesn’t provide modular RPMs, then you don’t need to create modular meta-data for it and can skip usage of a comps.xml and  
modules.yaml and just create the metadata with “createrepo\_c”.

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:26am UTC](https://forums.rockylinux.org/t/fix-no-available-modular-metadata-package-offline-repo/8713/6 "2023-08-25T03:26:37Z")

</div>

Closed on August 25, 2023, 3:26am UTC


