ubuntu dpkg安装卸载软件命令

太过爱你忘了你带给我的痛 2021-12-12 10:29 879阅读 0赞

dpkg --help命令查看用法:

  1. 用法:dpkg [<选项> ...] <命令>
  2. 命令:
  3. -i|--install <.deb 文件名> ... | -R|--recursive <目录> ...
  4. --unpack <.deb 文件名> ... | -R|--recursive <目录> ...
  5. -A|--record-avail <.deb 文件名> ... | -R|--recursive <目录> ...
  6. --configure <软件包名> ... | -a|--pending
  7. --triggers-only <软件包名> ... | -a|--pending
  8. -r|--remove <软件包名> ... | -a|--pending
  9. -P|--purge <软件包名> ... | -a|--pending
  10. -V|--verify <软件包名> ... 检查包的完整性。
  11. --get-selections [<表达式> ...] 把已选中的软件包列表打印到标准输出。
  12. --set-selections 从标准输入里读出要选择的软件。
  13. --clear-selections 取消选中所有不必要的软件包。
  14. --update-avail <软件包文件> 替换现有可安装的软件包信息。
  15. --merge-avail <软件包文件> 把文件中的信息合并到系统中。
  16. --clear-avail 清除现有的软件包信息。
  17. --forget-old-unavail 忘却已被卸载的不可安装的软件包。
  18. -s|--status <软件包名> ... 显示指定软件包的详细状态。
  19. -p|--print-avail <软件包名> ... 显示可供安装的软件版本。
  20. -L|--listfiles <软件包名> ... 列出属于指定软件包的文件。
  21. -l|--list [<表达式> ...] 简明地列出软件包的状态。
  22. -S|--search <表达式> ... 搜索含有指定文件的软件包。
  23. -C|--audit [<表达式> ...] 检查是否有软件包残损。
  24. --yet-to-unpack 列出标记为待解压的软件包。
  25. --predep-package 列出待解压的预依赖。
  26. --add-architecture <体系结构> 添加 <体系结构> 到体系结构列表。
  27. --remove-architecture <体系结构> 从架构列表中移除 <体系结构>。
  28. --print-architecture 显示 dpkg 体系结构。
  29. --print-foreign-architectures 显示已启用的异质体系结构。
  30. --assert-<特性> 对指定特性启用断言支持。
  31. --validate-<属性> <字符串> 验证一个 <属性>的 <字符串>。
  32. --compare-vesions <a> <关系> <b> 比较版本号 - 见下。
  33. --force-help 显示本强制选项的帮助信息。
  34. -Dh|--debug=help 显示有关出错调试的帮助信息。
  35. -?, --help 显示本帮助信息。
  36. --version 显示版本信息。
  37. Assert 特性: support-predepends, working-epoch, long-filenames,
  38. multi-conrep, multi-arch, versioned-provides.
  39. 可验证的属性:pkgname, archname, trigname, version.
  40. 调用 dpkg 并带参数 -b, --build, -c, --contents, -e, --control, -I, --info,
  41. -f, --field, -x, --extract, -X, --vextract, --ctrl-tarfile, --fsys-tarfile
  42. 是针对归档文件的。 (输入 dpkg-deb --help 获取帮助)
  43. 选项:
  44. --admindir=<目录> 使用 <目录> 而非 /var/lib/dpkg
  45. --root=<目录> 安装到另一个根目录下。
  46. --instdir=<目录> 改变安装目录的同时保持管理目录不变。
  47. --path-exclude=<表达式> 不要安装符合Shell表达式的路径。
  48. --path-include=<表达式> 在排除模式后再包含一个模式。
  49. -O|--selected-only 忽略没有被选中安装或升级的软件包。
  50. -E|--skip-same-version 忽略版本与已安装软件版本相同的软件包。
  51. -G|--refuse-downgrade 忽略版本早于已安装软件版本的的软件包。
  52. -B|--auto-deconfigure 就算会影响其他软件包,也要安装。
  53. --[no-]triggers 跳过或强制随之发生的触发器处理。
  54. --verify-format=<格式> 检查输出格式('rpm'被支持)。
  55. --no-debsig 不去尝试验证软件包的签名。
  56. --no-act|--dry-run|--simulate
  57. 仅报告要执行的操作 - 但是不执行。
  58. -D|--debug=<八进制数> 开启调试(参见 -Dhelp 或者 --debug=help)。
  59. --status-fd <n> 发送状态更新到文件描述符<n>。
  60. --status-logger=<命令> 发送状态更新到 <命令> 的标准输入。
  61. --log=<文件名> 将状态更新和操作信息到 <文件名>。
  62. --ignore-depends=<软件包>,...
  63. 忽略关于 <软件包> 的所有依赖关系。
  64. --force-... 忽视遇到的问题(参见 --force-help)。
  65. --no-force-...|--refuse-...
  66. 当遇到问题时中止运行。
  67. --abort-after <n> 累计遇到 <n> 个错误后中止。
  68. 可供--compare-version 使用的比较运算符有:
  69. lt le eq ne ge gt (如果版本号为空,那么就认为它先于任意版本号);
  70. lt-nl le-nl ge-nl gt-nl (如果版本号为空,那么就认为它后于任意版本号);
  71. < << <= = >= >> > (仅仅是为了与主控文件的语法兼容)。
  72. 'apt' 'aptitude' 提供了更为便利的软件包管理。
  73. 用法:dpkg-deb [<选项> ...] <命令>
  74. 命令:
  75. -b|--build <目录> [<deb>] 构建一个软件包。
  76. -c|--contents <deb> 列出所含内容。
  77. -I|--info <deb> [<cfile> ...] 打印相关信息到标准输出。
  78. -W|--show <deb> 打印对应软件包的简明信息。
  79. -f|--field <deb> [<cfield> ...] 把字段内容打印到标准输出。
  80. -e|--control <deb> [<目录>] 将主控信息解压。
  81. -x|--extract <deb> <目录> 将所有文件解压。
  82. -X|--vextract <deb> <目录> 解压所有文件并打印其列表。
  83. -R|--raw-extract <deb> <目录>
  84. 解压控制信息和控制文件。
  85. --ctrl-tarfile <deb> 输出控制文件的tar文件。
  86. --fsys-tarfile <deb> 输出文件系统的 tar 文件。
  87. -?, --help 显示本帮助信息。
  88. --version 显示版本信息。
  89. <deb> Debian 格式归档文件的文件名。
  90. <cfile> 是管理文件组件的文件名。
  91. <cfield> 是主控文件中的属性字段的名字。
  92. Options:
  93. -v, --verbose Enable verbose output.
  94. -D, --debug Enable debugging output.
  95. --showformat=<format> Use alternative format for --show.
  96. --deb-format=<format> Select archive format.
  97. Allowed values: 0.939000, 2.0 (default).
  98. --nocheck Suppress control file check (build bad
  99. packages).
  100. --root-owner-group Forces the owner and groups to root.
  101. --[no-]uniform-compression Use the compression params on all members.
  102. -z# Set the compression level when building.
  103. -Z<type> Set the compression type used when building.
  104. Allowed types: gzip, xz, zstd, none.
  105. -S<strategy> Set the compression strategy when building.
  106. Allowed values: none; extreme (xz);
  107. filtered, huffman, rle, fixed (gzip).
  108. 格式串的语法:
  109. 格式串是用于显示每一个软件包的字符串。格式串可以包含标准的
  110. 脱字符(escape sequences),如 \n (换行)、\r (回车)、或是 \\ (反斜杠)。
  111. 还可以通过加入软件包属性的变量引用来反映软件包的相关信息,
  112. 要在某些字段引用属性变量的话,可以用这样的语法:${var[;width]}。
  113. 字段一般是靠右对齐的,除非它的宽度是负数。若其宽度是负数,
  114. 那么字段将会靠左对齐。
  115. 使用 dpkg 命令可以在系统中安装和卸载软件包,
  116. apt aptitude 命令则用于简便的软件包管理。另外,
  117. 通过 dpkg-deb --extract 命令解压的软件包将
  118. 不会被正确安装!

具体示例:

linux软件卸载方法及dpkg命令的使用

发表评论

表情:
评论列表 (有 0 条评论,879人围观)

还没有评论,来说两句吧...

相关阅读