0

I have a RHEL 7.8 system. If I do rpm -qa it lists 2,551 rpm's.

When I do reposync it shows 13,314 rpm's to be downloaded. And under /var/cache/yum/ under the respective repositories there is a packages folder and now also a Packages folder.

I let reposync run overnight, ended up with the Packages folder having 50GB or more of stuff and it has a bunch of subfolders a/ b/ c/ d/.

My repositories are this:

  • epel
  • rhel-7-server-extras-rpms
  • rhel-7-server-optional-rpms
  • rhel-7-server-rpms

Is there a way to only re- download the rpm's that I actually have installed on the system? For example, everything on the install DVD or RHEL is less than ~4.5GB, and I know I'm not using everything on that. Even with the handful of extra software installed from epel and extra/optional repo's I should easily be able to fit all on a single 4.5GB DVD, and I'm expecting to only need 2,551 rpm's. How can I simply download the current/latest version of all these rpm's installed on my system?

Can someone provide a high level explanation so I can understand what is happening? Is reposync downloading every rpm of a given repository?

3
  • 1
    Yes, reposync is downloading every RPM; its job is to synchronize repositories. It sounds like you instead want a local copy of each RPM that is currently installed?
    – Jeff Schaller
    Commented Jun 10, 2020 at 15:06
  • yes, for managing offline servers that are identical to my online server
    – ron
    Commented Jun 10, 2020 at 15:16
  • Maybe turn your question around so that instead of being stuck trying to "fix" reposync, you lead with "I want (this) and I tried reposync, but how do I actually get (this)"?
    – Jeff Schaller
    Commented Jun 10, 2020 at 15:24

1 Answer 1

4

Is there a way to only re- download the rpm's that I actually have installed on the system?

You could couple the output from rpm -qa and use yumdownloader or yum --downloadonly (this will download the RPMs, and dependencies, for the installed packages, not potential updates thereof)

yum reinstall --downloadonly --downloaddir=/path/to/local/files `rpm -qa`

Note the reinstall, as install would see that the packages are already there and yum wouldn't take any further action.

Can someone provide a high level explanation so I can understand what is happening? Is reposync downloading every rpm of a given repository?

From the man page:

reposync is used to synchronize a remote yum repository to a local directory, using yum to retrieve the packages.

So the use case might be if you want high availability backup repo locally, or expect that packages may be removed from the remote repo.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .