I am working on Oracle Linux and trying to create a local repository. I managed to create a .repo entry which points to a directory in my system. The directory contains an RPM package.

But when I use the command "yum repolist", it shows the repository but lists the status of the repository to be zero. But the directory does contain RPM packages.


Here's the .repo file.


I tried running createrepo on the directory again and I am getting the following output.

[root@ttnetwork /]# createrepo /rhel_gnu_repo/
Spawning worker 0 with 2 pkgs
Worker 0: Error: Could not open local rpm file: /rhel_gnu_repo//avidemux-2.6.12-5.fc24.i686.rpm: RPM Error opening Package
Worker 0: Error: Could not open local rpm file: /rhel_gnu_repo//avidemux.rpm: RPM Error opening Package
Workers Finished
Gathering worker results
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

These are the contents of the folder. contents

  • (1) please do not post images of text, (2) how the file in /etc/yum.repos.d/ looks? – grochmal Aug 27 '16 at 13:59
  • it's the console picture. and i added the file too – Alchemist Aug 27 '16 at 14:10
  • Can you post the contents of the folder? Did you run createrepo in that folder? – zhenech Aug 27 '16 at 14:12
  • Yes I just tried again and I realize I am getting another error. i am going to post it – Alchemist Aug 27 '16 at 14:22

This question had a bunch of problems. I was able to solve them and get the local repository working. I will post the solution to these problems here.

  1. The status of the repolist should not be zero. It should be equal to the number of RPM packages available. This answer shows exactly how to solve this problem.

  2. The createrepo command was giving errors because the RPM package was corrupted. It mustn't have been downloaded properly. Use the yum "download-only" extension to make sure you download a proper RPM package.

  3. Make sure you have only RPM packages in your repo directory. The directories I had in that directory were also causing problems. This should solve your issues regarding local repositories.

  • 1
    thanks, the 1. was usefull ! – Julien Greard Nov 30 '20 at 14:54

In our case, we got the same error due to rpm file that was corrupted.

Fix was to re-download the rpm, then rerun the create repo command.


The question shows that createrepo failed to open the RPM files, so it is not surprising that there is nothing in the repodata directory.

The apparent problem is the trailing slash on this command:

createrepo /rhel_gnu_repo/

which is confusing createrepo. You probably meant

createrepo /rhel_gnu_repo
  • Still getting the same error even without the trailing slash – Alchemist Aug 27 '16 at 17:03
  • With a # prompt, you're probably running as root, so the other possibility is that you're trying to use RPMs on a machine with an older version rpm which does not support the compression type, etc. – Thomas Dickey Aug 27 '16 at 17:25
  • But I have worked with rpm packages before, installed some for instance. Is there a way to test this? Should I try using some other RPMs? And what do you mean by compression type? – Alchemist Aug 27 '16 at 17:31
  • 1
    A few years ago, the RPM program switched from gzip-compression to xz-compression. See this for example. – Thomas Dickey Aug 27 '16 at 17:38
  • I will try to determine if this is the case and get back to you afterwards. – Alchemist Aug 27 '16 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.