reposync

Synchronize yum repository to local directory

Summary

reposync [options]

The main purpose

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

Options

-h, --help
# Display help information

-c CONFIG, --config=CONFIG
#Specify the configuration file (default is /etc/yum.conf)

-a ARCH, --arch=ARCH
#Specify arch

--source
# Download src and rpm files at the same time.

-r REPOID, --repoid=REPOID
# Specify the repo id to be queried, which can be specified multiple times (all enabled by default).

-e CACHEDIR, --cachedir CACHEDIR
# Directory to store metadata.

-t, --tempcache
# Use temporary directory to store/access yum-cache.

-d, --delete
# Remove local packages that no longer exist in the repository.

-p DESTDIR, --download_path=DESTDIR
#Specify the download path: the default is the current directory.

--norepopath
# Do not add renames to the download path. Can only be used when syncing a single repository (default is to add rename).

-g, --gpgcheck
# Delete packages that failed GPG signature check after downloading. If at least one package was deleted, the exit status is "1".

-u, --urls
# Only list the URLs of the content to be downloaded, do not download.

-l, --plugins
# Enable yum plug-in support.

-m, --downloadcomps
# Download comps.xml at the same time.

--download-metadata
# Download all non-default metadata.

-n, --newest-only
# Only download the latest package for each repo.

-q, --quiet
# Output as little information as possible.

--allow-path-traversal
# Allow synchronization of packages stored outside the repo directory. These packages are referenced in the metadata by using absolute paths or parent ".." systems and are usually skipped in reposync for security reasons.
# NOTE: Using this option is a potential security risk, because by providing malicious repodata, an attacker can cause reposync to write to an arbitrary location on the file system that is accessible to the user running the file system.

example

# Synchronize all packages in the 'updates' warehouse to the current directory:
reposync --repoid=updates

# Only synchronize the latest packages from the 'updates' repository to the current directory:
reposync -n --repoid=updates

# Synchronize packages in the 'updates' and 'extras' repositories to the current directory:
reposync --repoid=updates --repoid=extras

# Synchronize all packages in the 'updates' warehouse to the repos directory:
reposync -p repos --repoid=updates

# Synchronize all packages in the 'updates' warehouse to the repos directory, excluding x86_64 architecture files. Edit /etc/yum.conf and add the option exclude=*.x86_64. Execute again:
reposync -p repos --repoid=updates

document

reposync uses the yum library to retrieve information and packages. If no configuration file is specified, the default yum configuration will be used.

*/etc/yum.conf