This is an old revision of the document!
# dnf install -y dnf-utils createrepo
The reposync command is used to synchronize a remote yum repository to a local directory, using yum to retrieve the packages.
# mkdir -p /software/redhat/8/base # /usr/bin/reposync --newest-only --repoid=rh8_baseos_latest -p /software/redhat/8/base # /usr/bin/createrepo /software/redhat/8/base
script example
#!/bin/bash logpath=/var/log logname=$logpath/repo_sync_$(date +%Y.%m.%d).log # Remove old logs find $logpath/repo_sync* -mtime +5 -delete; >> $logname 2>&1 # Sync repositories /usr/bin/reposync --newest-only --repoid=rh8_baseos_latest -/software/redhat/8/base >> $logname 2>&1 /usr/bin/createrepo /software/redhat/8/base/getPackage/ >> $logname 2>&1
# reposync –gpgcheck -l –repoid=rhel-6-server-rpms –download_path=/var/www/html
Using a proxy with Yum
# vi /etc/yum.conf proxy=http://someproxyserver.com:8000 proxy_username=proxyuser proxy_password=proxypass ...