← 返回命令列表

Linux command

rpm2cpio 命令

文件

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Convert

rpm2cpio [path/to/file.rpm] > [file.cpio]

Extract

rpm2cpio [path/to/file.rpm] | cpio -idmv

List

rpm2cpio [path/to/file.rpm] | cpio -t

说明

rpm2cpio strips the RPM lead, signature, and header sections from a `.rpm` file and writes the embedded cpio payload to standard output. This allows extracting the contents of an RPM package without installing it or relying on the `rpm` database. The cpio archive is in `newc` format (or `xz`/`lzma`/`zstd`-compressed payload, decompressed transparently by recent rpm builds) and preserves owner, mode, and directory structure as the RPM would install them. It is almost always piped to cpio (or bsdtar, which understands the same format) for listing or extraction.

参数

file.rpm
The RPM package file to convert (reads from stdin if omitted)

FAQ

What is the rpm2cpio command used for?

rpm2cpio strips the RPM lead, signature, and header sections from a `.rpm` file and writes the embedded cpio payload to standard output. This allows extracting the contents of an RPM package without installing it or relying on the `rpm` database. The cpio archive is in `newc` format (or `xz`/`lzma`/`zstd`-compressed payload, decompressed transparently by recent rpm builds) and preserves owner, mode, and directory structure as the RPM would install them. It is almost always piped to cpio (or bsdtar, which understands the same format) for listing or extraction.

How do I run a basic rpm2cpio example?

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

What does file.rpm do in rpm2cpio?

The RPM package file to convert (reads from stdin if omitted)