createrepo

Create YUM warehouse

Summary

createrepo [options] <directory>

describe

createrepo is a program that creates an RPM metadata repository, a YUM repository, from a set of RPMs.

Options

-u --baseurl <url>
#Specify the address of the Base URL

-o --outputdir <url>
#Specify the output location of metadata

-x --excludes <packages>
# Specify packages that need to be excluded when forming metadata

-i --pkglist <filename>
# Specify a file. The package information in the file will be included in the metadata to be generated. The format is that each package information has its own line, excluding wildcards, regular expressions, and range expressions.

-n --includepkg
# Specify the package information to be included in the local library through the command line, and you need to provide a URL or local path.

-q --quiet
# Perform operations in quiet mode and do not output any information.

-g --groupfile <groupfile>
# Specify the group division of the local software repository, example: createrepo -g comps.xml /path/to/rpms
# Note: The group file needs to be placed in the same path as the rpm package.

-v --verbose
# Output detailed information.

-c --cachedir <path>
# Specify a directory to store the checksum information of software packages in the software warehouse.
# When createrepo continues to run multiple times on the same warehouse file that has not changed significantly, specifying cachedir will significantly improve its performance.

--basedir
# Basedir is the path to the directory in repodata, which defaults to the current working directory.

--update
# If the metadata already exists and only part of the software in the software warehouse has been changed, added or deleted,
#The update parameter can be used to directly upgrade the original metadata, which is much more efficient than reanalyzing rpm package dependencies and generating new metadata.

--skip-stat
# Skip the stat() call on --update, assuming the file is still the same if the filename is the same (only use this method if you are reasonably trustworthy or gullible).

--update-md-path
# Use existing repodata to upgrade from this path.

-C --checkts
# Don't generate repo metadata if their timestamp is newer than rpm. This option will again drastically reduce processing time for an unmodified repo if you happen to have it turned on, but it is (currently) mutually exclusive with the --split option. NOTE: This command will not notice when a package is removed from the repo. Use --update to handle this.

--split
# Run in split media mode. Rather than passing a single directory, get a set of directories corresponding to different volumes in the media set.

-p --pretty
# Output the xml file in a neat format.

--version
# Output version.

-h --help
# Display the help menu.

-d --database
# This option specifies using SQLite to store the generated metadata, the default item.

--no-database
# Do not generate sqlite database in repository.

-S --skip-symlinks
# Ignore package symbolic links

-s --checksum
# Select the checksum type used in repmed .xml and the package in the metadata. The default value is now "sha256" (if python has hashlib). The old default was "sha", which was actually "sha1", but using "sha1" explicitly does not work on older versions (3.0.x) of yum, you need to specify "sha".

--profile
# Output time-based analysis information.

--changelog-limit CHANGELOG_LIMIT
# Import only the last N changelog entries in each rpm into metadata

--unique-md-filenames
# Include the file's checksum in the metadata filename to aid in HTTP caching (default)

--simple-md-filenames
# Do not include the file's checksum in the metadata file name.

--retain-old-md
# Keep the latest (by timestamp) N copies of the old repodata (so clients using the old repodata .xml file can still access it). Default is 0.

--distro
Specify the release label. Can be specified multiple times. Optional syntax, specify cpeid (http://cpe.mitre.org/)——distro=cpeid,distrotag

--content
# Specify keywords/tags about the repository content. Can be specified multiple times.

--repo
# Specify keywords/tags about the repository itself. Can be specified multiple times.

--revision
# Arbitrary string for the repository revision.

--deltas
# Tell createrepo to generate incremental data and incremental metadata

--oldpackagedirs PATH
# Look for older PKGS to counter the path. Can I specify multiple times?

--num-deltas int
# The number of old versions to be incremented. Default is 1

--read-pkgs-list READ_PKGS_LIST
# Use --update to output the path to PKGS which is actually useful for reading

--max-delta-rpm-size MAX_DELTA_RPM_SIZE
# Maximum size (in bytes) of the RPM to run deltarpm on

--workers WORKERS
# Number of worker threads generated for reading RPMS

--compress-type
# Specify the compression method to use: compat (default), xz (may not be available), gz, bz2.

return value

The return status is success unless illegal options or illegal parameters are given.

example

# Generate a repository with groups files. Note that the groups file should be in the same directory as the rpm package (i.e. /path/to/rpms/comps.xml).
createrepo -g comps.xml /path/to/rpms