← 返回命令列表

Linux command

createrepo 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Initialize

createrepo [path/to/directory]

Example

createrepo -v -x [test_*.rpm] [path/to/directory]

Example

createrepo -S -s sha1 [path/to/directory]

说明

createrepo initializes an RPM repository by creating the metadata files required by yum/dnf package managers. It scans a directory containing RPM packages and generates a repodata subdirectory with XML metadata files and SQLite databases describing available packages. The generated metadata includes package names, versions, dependencies, file lists, and checksums. This enables yum/dnf clients to query package information, resolve dependencies, and perform installations from the repository without downloading every RPM file. The tool is essential for creating local repositories, custom enterprise package distributions, or mirror sites.

参数

-v, --verbose
Verbose output
-x, --excludes _pattern_
Exclude packages matching pattern
-s, --checksum _type_
Checksum algorithm (sha1, sha256, etc.)
-S, --skip-symlinks
Ignore symbolic links
-u, --baseurl _url_
Base URL for the repository
--update
Update existing repository (faster)

FAQ

What is the createrepo command used for?

createrepo initializes an RPM repository by creating the metadata files required by yum/dnf package managers. It scans a directory containing RPM packages and generates a repodata subdirectory with XML metadata files and SQLite databases describing available packages. The generated metadata includes package names, versions, dependencies, file lists, and checksums. This enables yum/dnf clients to query package information, resolve dependencies, and perform installations from the repository without downloading every RPM file. The tool is essential for creating local repositories, custom enterprise package distributions, or mirror sites.

How do I run a basic createrepo example?

Run `createrepo [path/to/directory]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -v, --verbose do in createrepo?

Verbose output