Ubuntu系统下如何dpkg-deb?

2025-04-25 05:39:55
推荐回答(2个)
回答1:

sudo dpkg-deb xxx

命令详细用法如下:
用法:dpkg-deb [<选项> ...] <命令>

Commands:
-b|--build [] Build an archive.
-c|--contents List contents.
-I|--info [ ...] Show info to stdout.
-W|--show Show information on package(s)
-f|--field [ ...] Show field(s) to stdout.
-e|--control [] Extract control info.
-x|--extract Extract files.
-X|--vextract Extract & list files.
-R|--raw-extract
Extract control info and files.
--fsys-tarfile Output filesystem tarfile.

-h|--help 显示本帮助信息。
--version 显示版本信息。

是 Debian 格式归档文件的文件名。
是管理文件组件的文件名。
是主 control 文件中的属性字段的名字。

Options:
--showformat= Use alternative format for --show.
-v, --verbose Enable verbose output.
-D Enable debugging output.
--old, --new Select archive format.
--nocheck Suppress control file check (build bad
packages).
-z# Set the compression level when building.
-Z Set the compression type used when building.
Allowed types: gzip, xz, bzip2, lzma, none.

格式串的语法:
格式串是用于显示每一个软件包的字符串。格式串可以包含标准的
脱字符(escape sequences),如 \n (换行)、\r (回车)、或是 \\ (反斜杠)。
还可以通过加入软件包属性的变量引用来反映软件包的相关信息,
要在某些字段引用属性变量的话,可以用这样的语法:${var[;width]}。
字段一般是靠右对齐的,除非它的宽度是负数。若其宽度是负数,
那么字段将会靠左对齐。

使用 dpkg 命令可以在系统中安装和卸载软件包,
dselect 命令则用于简便的软件包管理。另外,
通过 dpkg-deb --extract 命令解压的软件包将不
会被正确安装!

回答2:

sudo dpkg -i xxx.deb