5

deb 软件包里都有什么

 2 years ago
source link: https://blog.frytea.com/archives/591/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

deb 软件包里都有什么

October 28, 2021 • Read: 68 • 技术价值

本文首发于: https://blog.frytea.com/archives/591/

日常工作学习常常会在 Debian 系操作系统中完成,特别是最近自己开始打包、安装,发现 .deb 安装包甚至可以包含内核,且 Debian 就是通过这种方式来管理内核的,那么 deb 软件包中究竟有那些内容呢?

debDebian软件包 格式,文件扩展名.deb,跟 Debian 的命名一样,deb 也是因 Debra Murdock(Debian 创始人 Ian Murdock 的前妻)而得名。处理这些包的经典程序是 dpkg ,经常是通过 apt 来运作。

流行的的 Ubunut,国内的 Deepin、麒麟等操作系统都是使用这一软件包格式进行软件包管理和分发的,今天就来简单探索一下 deb 软件包中都有什么东西。

这里以 dpkg 软件包为例,看一下这其中都包括了那些内容:

$ ar t dpkg_1.19.7_amd64.deb
debian-binary
control.tar.gz
data.tar.xz
$ ar x dpkg_1.19.7_amd64.deb
control.tar.gz data.tar.xz debian-binary dpkg_1.19.7_amd64.deb
$ tar tJf data.tar.xz | head -n 16
./etc/dpkg/
./etc/dpkg/dpkg.cfg
./etc/dpkg/dpkg.cfg.d/
$ tar tJf control.tar.xz
./control
$ cat debian-binary

使用 ar (建立,修改档案或从档案中抽取成员的软件工具)可以看到 Debian 包的 ar 存档格式由三个文件组成:

  • debian-binary : 指定软件包格式版本,在 Debian Buster 中它仍然是 2.0 版本。
  • control.tar.xz : 包含所有可用的 元信息,比如包的 名称版本,以及在 (取消) 安装之前、期间或之后运行的一些脚本。
  • data.tar.xzdata.tar.bz2data.tar.gz : 包含要从包中提取的所有文件;这是存储可执行文件、库、文档等的地方。

这就是 deb 软件包中包含的内容,想要更详细的了解其中内容推荐大家阅读 《Debian 管理员手册》,必将受益匪浅。

---------------------
Author: Frytea
Title: deb 软件包里都有什么
Link: https://blog.frytea.com/archives/591/
Copyright: This work by TL-Song is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK