User Tools

Site Tools


linux:yum_reposync

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:yum_reposync [2021/07/26 13:24]
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 81: Line 84:
     Output as little information as possible. ​     Output as little information as possible. ​
 </​code>​ </​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>​
 +
linux/yum_reposync.1627298676.txt.gz · Last modified: 2021/07/26 13:24 by manu