Beruflich Dokumente
Kultur Dokumente
C U S T O M E R (https://access.redhat.com/)
P O R TA L
Environment
Red Hat Enterprise Linux 8
Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 5
Red Hat Network (RHN)
Red Hat Subscription Management (RHSM)
reposync
Issue
What is reposync utility and how to use it?
How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, or 8
without using Satellite server
Need to download all packages / rpms from specific channel locally
How to make a local repository
Resolution
RHEL 5,6,7
RHEL 8
https://access.redhat.com/solutions/23016 1/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
In the targeted directory, there will be a new directory named after the Repository ID. All
the downloaded packages will be inside this directory.
# cd /var/www/html/<repo-id>
# createrepo -v /var/www/html/<repo-id>
To have access to the group data for the newly synced repo, please run the createrepo
command as follows:
# cd /var/www/html/<repo-id>
# createrepo -v /var/www/html/<repo-id>/ -g comps.xml
https://access.redhat.com/solutions/23016 2/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
C U S T O M E R (https://access.redhat.com/)
P O R TA L
Modify the repodata to define which packages are security
related.
These steps require that the createrepo command has already been run.
From the find command above, identify the updateinfo.xml that matches the that you ran
reposync against and move that file into your repodata directory.
# mv updateinfo.xml /var/www/html/<repo-id>/repodata/updateinfo.xml
# modifyrepo /var/www/html/<repo-id>/repodata/updateinfo.xml /var/www/html/<repo-
id>/repodata
NOTE:
createrepo is not required for RHEL 8. reposync will download everything including the
repodata.
NOTE:
To keep the sync current, for example, cronjobs can be used. The createrepo command
supports --update to efficiently update existing repositories.
The locally created repository is typically used by other RHEL clients via LAN, for example
via HTTP/HTTPS (for example provided by the apache webserver which is part of RHEL),
https://access.redhat.com/solutions/23016 3/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
Root Cause
Red Hat provides a utility called reposync which can be used to download the packages from
the CDN. In order to download all packages from a specific channel, the system should be
subscribed to that channel. If the system is not subscribed to the required channel then
reposync will not be able to download and sync those packages on local system.
Diagnostic Steps
createrepo-0.9.9-26.el6.noarch which is part of RHEL6.9GA has an issue regarding
--update , refer to bz1434369 (https://bugzilla.redhat.com/show_bug.cgi?id=1434369) for
details.
yum (/tags/yum)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of
solutions that Red Hat engineers have created while supporting our customers. To give you the
knowledge you need the instant it becomes available, these articles may be presented in a raw
and unedited form.
C U S T O M E R (https://access.redhat.com/)
When using reposync to update a local repo, why is it downloading all of the packages
P O R TA L
again?
Why yum grouplist "" does not list the groups in repository in Red Hat Enterprise Linux
7?
79 Comments
5 August 2011 12:32 PM (https://access.redhat.com/solutions/23016#comment-332103)
GA gao_whited (/user/506863)
(/user/506863)
How can one do this for multiple software channels and architectures ? I am trying
COMMUNITY to maintain servers and workstations in both 32 and 64 bit and I need to try to do it
MEMBER
without Satellite.
40 Points
≤ Reply (/Ajax_comments/Reply/23016/332103)
https://access.redhat.com/solutions/23016 5/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
Createrepo in both directories, configure a service to serve your rpm's and you're
ready to go.
≤ Reply (/Ajax_comments/Reply/23016/332203)
Thanks
≤ Reply (/Ajax_comments/Reply/23016/332273)
40 Points
≤ Reply (/Ajax_comments/Reply/23016/1034421)
≤ Reply (/Ajax_comments/Reply/23016/332253)
C U S T O M E R (https://access.redhat.com/)
P O R TA L
9 August 2011 11:55 AM (https://access.redhat.com/solutions/23016#comment-332283)
GA gao_whited (/user/506863)
(/user/506863)
OK, but is it possible to get both a 32 bit and 64 bit channel repo sync'ed onto a 64
COMMUNITY bit machine ?
MEMBER
40 Points For the purposes of a repo-server, can one subscribe one physical box to multiple
channels ?
≤ Reply (/Ajax_comments/Reply/23016/332283)
3594 As reposync has the ability to sync packages only from the channels/repositories to
Points which it has access, it is not possible sync multiple arch channels from RHN on the
same system.
≤ Reply (/Ajax_comments/Reply/23016/332323)
≤ Reply (/Ajax_comments/Reply/23016/860593)
C U S T O M E R (https://access.redhat.com/)
P O R TA L
2 December 2015 11:29 PM (https://access.redhat.com/solutions/23016#comment-992683)
TB Thomas Bludau (/user/2756823)
(/user/2756823)
Did anyone knows a solution for the different minor releases?
NEWBIE
39 Points you need to extract the URL's from your entitlement cert (rct works decebnt for
this). then make a custom yum.conf with the URL, your client cert and such and
finally run reposync giving it a path to download to
was able to run reposync just fine to slurp down rhels7 content sets while running on
a rhels6 install util box.
≤ Reply (/Ajax_comments/Reply/23016/1019361)
https://access.redhat.com/solutions/23016 8/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
The reposync command in the script I use looks like (I noticed that you use -g here. I
did not have that, but I added it and it made no difference as one would expect. Also
removing -q does not add anything useful to the output messages. Adding the -t
option also makes no difference)
~~~
~~~
For each of a number of certain packages, consistent which ones, but most
packages do not produce these messages, I get
~~~
~~~
≤ Reply (/Ajax_comments/Reply/23016/477383)
≤ Reply (/Ajax_comments/Reply/23016/477453)
≤ Reply (/Ajax_comments/Reply/23016/560563)
Thanks much,
Dumitru
≤ Reply (/Ajax_comments/Reply/23016/692313)
≤ Reply (/Ajax_comments/Reply/23016/762463)
C U S T O M E R (https://access.redhat.com/)
P O R TA L
3 December 2018 8:53 AM (https://access.redhat.com/solutions/23016#comment-1393551)
153 Points
≤ Reply (/Ajax_comments/Reply/23016/1393551)
33 Points Thanks!
≤ Reply (/Ajax_comments/Reply/23016/777483)
≤ Reply (/Ajax_comments/Reply/23016/827373)
https://access.redhat.com/solutions/23016 11/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
C U S T O M E R (https://access.redhat.com/)
29 May 2015 12:19 PM (https://access.redhat.com/solutions/23016#comment-924973)
MY
P O R TA L
Mahesh Yellapu (/user/9472923)
(/user/9472923)
Hi Matthew,
NEWBIE
You can disable it by enable=0 in /etc/yum/pluginconf.d/rhnplugin.conf
5 Points
≤ Reply (/Ajax_comments/Reply/23016/924973)
≤ Reply (/Ajax_comments/Reply/23016/954493)
How do I download the security metadata so that I can use the yum-security plugin
with this mirror?
≤ Reply (/Ajax_comments/Reply/23016/958743)
(/user/4037303)
Here's what I've been doing to keep the metadata. It's not elegant but it works by
C U S T O M E R (https://access.redhat.com/)
COMMUNITY just copying
P Othe
R TAmetadata
L from the local cache every time.
MEMBER
#!/bin/bash
#==============================================================================
# Title : syncRepo.sh
#
# Description : Synchronizes the local RHEL repository to RHN
#
# Author : Firas AlShafei
#
# Version : v1.1
#
#==============================================================================
RELEASE=rhel-x86_64-server-5
# Create metadata
yum --disablerepo=* --enablerepo=$RELEASE makecache
≤ Reply (/Ajax_comments/Reply/23016/960453)
23 Points Pls provide the solution if we don't have both the alternatives(rhn connectitivty and
satellite server).
≤ Reply (/Ajax_comments/Reply/23016/1009521)
≤ Reply (/Ajax_comments/Reply/23016/1009581)
Regarding alternatives: Does Red Hat supply any (metadata) distribution schemes
or interfaces which are (loosely) analogous to https://support.microsoft.com/en-
ca/kb/913086?
Thanks!
https://access.redhat.com/solutions/23016 14/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
≤ Reply (/Ajax_comments/Reply/23016/1057321)
C U S T O M E R (https://access.redhat.com/)
P O R TA L
9 June 2016 2:39 AM (https://access.redhat.com/solutions/23016#comment-1057491)
GURU
What are the least privileges that successfully download rpms and metadata
3740
without flipping bits? (I would like to download rpms and metadata from a
Points
limited user account. ) I think the user needs to be able to register a system
under the account and be able to receive packages. The latter part can be
verified in having the user download a package from the customer portal
download area. The metadata pieces are included in this. I think the required
permissions are at this point not documented more verbosely. One could
either try this out (restrict an account as far as possible) or have us investigate
and document this with a customer center case.
As for interfaces to access data about security fixes in an automated way, "yum
security" on an installed system or https://access.redhat.com/solutions/4161
(describing our OVAL data) are a good start.
≤ Reply (/Ajax_comments/Reply/23016/1057491)
https://access.redhat.com/solutions/23016 15/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
C U S T O M-n
#if [ "$(getfacl (https://access.redhat.com/) |grep group:####:r-- |wc -
E R /etc/pki/entitlement/*-key.pem
P O R TA L
l)" != "1" ]; then exit 1; fi
#yum clean all
#rm -rf upstreamrepo
#reposync --gpgcheck -l -u --repoid=upstreamrepo -d --downloadcomps --download-
metadata --download_path `pwd` | gzip -9 -c > upstreamrepo.url.txt.gz
#createrepo -v `pwd`/<upstreamrepo> -g comps.xml
#pushd upstreamrepo
#cp *updateinfo.xml.gz repodata/updateinfo.xml.gz
#gunzip repodata/updateinfo.xml.gz
#modifyrepo `pwd`/repodata/updateinfo.xml `pwd`/repodata/
#popd
≤ Reply (/Ajax_comments/Reply/23016/1158681)
GURU
≤ Reply (/Ajax_comments/Reply/23016/1158871)
3740
Points
≤ Reply (/Ajax_comments/Reply/23016/1159231)
ACTIVE If I'm following this correctly, I believe you are trying to include the security data in
CONTRIBUTOR
your local repository yes? If you haven't seen this it may help.
197 Points
https://access.redhat.com/solutions/55654
Then you will want to use modifyrepo as shown below to apply the security data to
C U S T O M E R (https://access.redhat.com/)
the repo. P O R TA L
# cd /var/cache/yum/<arch>/<release>/<upstreamrepo>/
# cp *updateinfo.xml.gz /<upstreamrepo>/repodata/updateinfo.xml.gz
# gzip -d /<upstreamrepo>/repodata/updateinfo.xml.gz
# modifyrepo /<upstreamrepo>/repodata/updateinfo.xml
/<upstreamrepo>/repodata/
Once all this is done, remember that clients connecting to this should run "yum clean
all" to ensure they remove the cached metadata and get the new metadata.
≤ Reply (/Ajax_comments/Reply/23016/1159251)
40 Points Question: Under what circumstances do the *-updateinfo file(s) below differ?
/upstreamrepo/*-updateinfo.xml.gz
/var/cache/yum/<arch>/<release>/<upstreamrepo>/*-updateinfo.xml.gz
≤ Reply (/Ajax_comments/Reply/23016/1159531)
≤ Reply (/Ajax_comments/Reply/23016/1159601)
≤ Reply (/Ajax_comments/Reply/23016/1160361)
https://bugzilla.redhat.com/show_bug.cgi?id=1296282
https://rhn.redhat.com/errata/RHBA-2016-2187.html
≤ Reply (/Ajax_comments/Reply/23016/1160511)
40 Points Hi, did you verify if createrepo option --update could help you here?
≤ Reply (/Ajax_comments/Reply/23016/1160371)
https://access.redhat.com/solutions/23016 18/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
(/user/6299943)
Would depend on whether you're doing a full sync or using the "only latest" option.
GURU Having done a reposync, today, of the 6-Server channel, using the "only latest"
6435 option cut the download from 17,000+ RPMs to a little over 4,000.
Points
≤ Reply (/Ajax_comments/Reply/23016/1057511)
≤ Reply (/Ajax_comments/Reply/23016/1057521)
≤ Reply (/Ajax_comments/Reply/23016/1048291)
https://access.redhat.com/solutions/23016 19/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
3740 "hosting" repos for all of these via protocols like http or nfs could be done on a single
Points C U S T O M E R (https://access.redhat.com/)
system likePaOCentos7
R TA L box. Yet, fetching does to my knowledge require one "RHEL"
per architecture and per major line. So for 32bit/64bit for rhel5/6/7, one can setup
KVM guests with these releases for fetching, and configure the host to offer the
fetched packages. In that config the host could also be RHEL7/64bit directly for
fetching this release, and 4 VMs could be used to cover the rhel5/6 flavours.
≤ Reply (/Ajax_comments/Reply/23016/1057531)
(/user/6299943)
Is there an easy way to grab just the comps.xml?
GURU
26 Points Doesn't the rhel-7-server-rpms channel include security updates for the packages
in that channel when they're released?
https://access.redhat.com/solutions/23016 20/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
/var/cache/yum/x86_64/7Server/rhel-7-server-thirdparty-oracle-java-
rpms/0afde39e01bc126f3d3335a6adddc87cc50e46c6ebfdd6574e8193e2aeedf14c-
updateinfo.xml.gz
≤ Reply (/Ajax_comments/Reply/23016/1060721)
≤ Reply (/Ajax_comments/Reply/23016/1158511)
somethings is wrong, and then having them open an after the fact support ticket or
C U S T O M E R (https://access.redhat.com/)
wasting a bunch
P O R TAof
L time trying to figure out why the local repo is not providing
update content. Maybe it should be moved up as an optional step without specific
details as it will vary greatly by preference and number of repositories that are
mirrored. Also this may be my over interpreting things but to me "local mirror," as
contained in the Issue section, makes me think of something that can be accessed
by more than just the box itself, using most likely http, https, ftp or sftp even though
other protocols will work. I would find it would be much more end user friendly if the
note "Above commands create a local copy ... or NFS (nfs-utils package)" were inline
before the "How to create a .repo file" link; along with some wording about "For
other boxes to access the repo you may need to;" and that "choosing which
distribution method to use and how to configure them is outside the scope of this
document." Mention something like "Though an apache http install and it's
configuration should be relatively easy due to the repositories being placed in
/var/www/html/” could be especially useful since the linked repo configuration page
is a very simple page with minimal information and the only example of a repo file
has http for the base url. With comments like these inline or maybe in the Resolution
section like the fact that the box has to be subscribed to the channel it would be
much clearer that additional steps are needed. Thank you for the changes you have
already made and for considering the following comments ideas for the main article.
≤ Reply (/Ajax_comments/Reply/23016/1159201)
20 Points
≤ Reply (/Ajax_comments/Reply/23016/1177871)
https://access.redhat.com/solutions/23016 22/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
COMMUNITY
MEMBER ≤ Reply (/Ajax_comments/Reply/23016/1189321)
C U S T O M E R (https://access.redhat.com/)
24 Points P O R TA L
≤ Reply (/Ajax_comments/Reply/23016/1189621)
Regards Thanks!
≤ Reply (/Ajax_comments/Reply/23016/1354041)
https://access.redhat.com/solutions/23016 23/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
≤ Reply (/Ajax_comments/Reply/23016/1419771)
C U S T O M E R (https://access.redhat.com/)
P O R TA L
10 January 2019 12:12 AM (https://access.redhat.com/solutions/23016#comment-1419991)
≤ Reply (/Ajax_comments/Reply/23016/1419991)
≤ Reply (/Ajax_comments/Reply/23016/1431041)
≤ Reply (/Ajax_comments/Reply/23016/1459301)
https://access.redhat.com/solutions/23016 24/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
Please feel free to use it and adapt it to your own needs. Feedback is welcome.
Best regards,
Joerg
≤ Reply (/Ajax_comments/Reply/23016/1468841)
≤ Reply (/Ajax_comments/Reply/23016/1528751)
≤ Reply (/Ajax_comments/Reply/23016/1537731)
C U S T O M E R (https://access.redhat.com/)
P O R TA L
3 June 2019 6:58 PM (https://access.redhat.com/solutions/23016#comment-1537751)
JC John Castranio (/user/10039653)
(/user/10039653)
Yes it should. I have updated the article now to correctly reflect that. Thank you for
RED HAT
letting me know.
ACTIVE
CONTRIBUTOR
197 Points
≤ Reply (/Ajax_comments/Reply/23016/1537751)
≤ Reply (/Ajax_comments/Reply/23016/1651241)
≤ Reply (/Ajax_comments/Reply/23016/1651281)
≤ Reply (/Ajax_comments/Reply/23016/1665841)
≤ Reply (/Ajax_comments/Reply/23016/1666401)
Then the clients would need a repo configuration to look at that 7.6 locked repo.
≤ Reply (/Ajax_comments/Reply/23016/1669001)
Please feel free to use it and adapt it to your own needs. Feedback is welcome.
https://access.redhat.com/solutions/23016 27/28
2/4/2020 How to create a local mirror of the latest update for Red Hat Enterprise Linux 5, 6, 7, 8 without using Satellite server? - Red Hat Custo…
last » (/solutions/23016?page=1)
Privacy Statement
(http://www.redhat.com/en/about/privacy-policy)
Customer Portal Terms of Use
(https://access.redhat.com/help/terms/)
All Policies and Guidelines
(http://www.redhat.com/en/about/all-policies-guidelines)
Copyright © 2020 Red Hat, Inc.
https://access.redhat.com/solutions/23016 28/28