This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:yum_reposync [2021/07/26 12:05] manu |
linux:yum_reposync [2022/10/24 19:33] (current) manu |
||
---|---|---|---|
Line 6: | Line 6: | ||
The reposync command is used to synchronize a remote yum repository to a local directory, using yum to retrieve the packages. | The reposync command is used to synchronize a remote yum repository to a local directory, using yum to retrieve the packages. | ||
+ | |||
+ | reposync --download-metadata --gpgcheck --plugins --repoid=rh8_baseos_latest --arch=ppc64le --newest-only -p /localrepo | ||
+ | |||
<cli prompt='#'> | <cli prompt='#'> | ||
# mkdir -p /software/redhat/8/base | # mkdir -p /software/redhat/8/base | ||
Line 28: | Line 31: | ||
</code> | </code> | ||
+ | # reposync --gpgcheck -l --repoid=rhel-6-server-rpms --download_path=/var/www/html | ||
+ | |||
+ | Using a proxy with Yum | ||
+ | |||
+ | <cli prompt='#'> | ||
+ | # vi /etc/yum.conf | ||
+ | proxy=http://someproxyserver.com:8000 | ||
+ | proxy_username=proxyuser | ||
+ | proxy_password=proxypass | ||
+ | ... | ||
+ | </cli> | ||
+ | |||
+ | Man page **reposync** | ||
+ | |||
+ | synchronize yum repositories to a local directory | ||
+ | |||
+ | OPTIONS | ||
+ | <code> | ||
+ | -h, --help | ||
+ | Display a help message, and then quit. | ||
+ | -c CONFIG, --config=CONFIG | ||
+ | Config file to use (defaults to /etc/yum.conf). | ||
+ | -a ARCH, --arch=ARCH | ||
+ | Act as if running the specified arch (default: current arch, note: does not override $releasever. x86_64 is a superset for i*86.). | ||
+ | --source | ||
+ | Also download .src.rpm files. | ||
+ | -r REPOID, --repoid=REPOID | ||
+ | Specify repo ids to query, can be specified multiple times (default is all enabled). | ||
+ | -e CACHEDIR, --cachedir CACHEDIR | ||
+ | Directory in which to store metadata. | ||
+ | -t, --tempcache | ||
+ | Use a temp dir for storing/accessing yum-cache. | ||
+ | -d, --delete | ||
+ | Delete local packages no longer present in repository. | ||
+ | -p DESTDIR, --download_path=DESTDIR | ||
+ | Path to download packages to: defaults to current directory. | ||
+ | --norepopath | ||
+ | Don't add the reponame to the download path. Can only be used when syncing a single repository (default is to add the reponame). | ||
+ | -g, --gpgcheck | ||
+ | Remove packages that fail GPG signature checking after downloading. exit status is '1' if at least one package was removed. | ||
+ | -u, --urls | ||
+ | Just list urls of what would be downloaded, don't download. | ||
+ | -l, --plugins | ||
+ | Enable yum plugin support. | ||
+ | -m, --downloadcomps | ||
+ | Also download comps.xml. | ||
+ | --download-metadata | ||
+ | Download all the non-default metadata. | ||
+ | -n, --newest-only | ||
+ | Download only newest packages per-repo. | ||
+ | -q, --quiet | ||
+ | Output as little information as possible. | ||
+ | </code> | ||
+ | |||
+ | ===== local repo with modules ===== | ||
+ | |||
+ | RHEL 8 | ||
+ | |||
+ | You should not use createrepo on a RHEL 8 repository or you will delete the module data. reposync was updated to download all of the repodata for you making a local repository, a single command. | ||
+ | |||
+ | # reposync --download-metadata --repo <repo-id> | ||
+ | |||
+ | To use createrepo on a RHEL 8 repository, download the files: | ||
+ | **comps.xml , updateinfo.xml , modules.yaml ** | ||
+ | |||
+ | <code> | ||
+ | # rm -rf /var/cache/dnf | ||
+ | # yum module list && yum updateinfo | ||
+ | # reposync --repo <repo-id> --download-path=/var/www/html | ||
+ | |||
+ | ### With the repository downloaded, we now need to build the repodata. We should be sitting in the root of the repository. | ||
+ | |||
+ | # cd /var/www/html/<repo-id> | ||
+ | |||
+ | # cp $(find /var/cache/dnf/<repo-id>* -name *comps.xml) comps.xml | ||
+ | # createrepo -g comps.xml ./ | ||
+ | |||
+ | ### Find and add the module data **NOTE** createrepo_c-0.16.2-2.el8 and later will automatically detect and include the modules.yaml, if present in the repo directory. | ||
+ | |||
+ | # gunzip $(find /var/cache/dnf/<repo-id>* -name *modules.yaml.gz) -c > modules.yaml | ||
+ | # modifyrepo modules.yaml repodata/ | ||
+ | |||
+ | ###Find and add the security data | ||
+ | # gunzip $(find /var/cache/dnf/<repo-id>* -name *updateinfo.xml.gz) -c > updateinfo.xml | ||
+ | # modifyrepo updateinfo.xml repodata/ | ||
+ | </code> | ||