# 安装

Dibab 通过单个软件包安装，步骤在 README 中（英文）：Debian 和 Ubuntu 见 [*Installation from the Debian package*](https://github.com/RonanDavalan/dibab#installation-from-the-debian-package) 一节，其他系统见 [*Installation on Fedora, openSUSE Leap and Arch*](https://github.com/RonanDavalan/dibab#installation-on-fedora-opensuse-leap-and-arch) 一节。本页不重复这些步骤：它说明软件包周围需要什么，以及全新安装的输出，方便您与自己的安装对照。本页面向使用 Debian、Ubuntu、Fedora、openSUSE Leap 或 Arch 的读者。

## 安装之前

各个软件包都在[下载页面](https://dibab.davalan.fr/zh/download/index.md)。软件包包含程序、五种语言的手册页、README 文件和一份示例配置。它不包含模型服务器、模型或配置；README 的 [*Requirements*](https://github.com/RonanDavalan/dibab#requirements) 一节列出了需要您自行准备的内容：

- 一个正在运行的模型服务器 [Ollama](https://ollama.com/)，每个角色（`ocr`、`tri_rapide`、`classification`）至少有一个模型；
- 每个领域一个目标文件夹，位于您在运行前打开的加密卷上：Dibab 会检查它是否已挂载，且从不自行挂载；
- 对于远程机器，需要一把无需密码即可打开会话的 `ssh` 密钥。

## 软件包已安装过的系统

下面每个系统的容器中都安装过相应的软件包，随后查询、以模拟方式运行并卸载（在 Debian 和 Ubuntu 上还彻底清除）。容器没有展示加密卷的挂载，也没有展示使用您自己的模型服务器和文档的运行。

- Debian 12，Python 3.11.2。
- Debian 13，Python 3.13.5。
- Ubuntu 22.04，Python 3.10.12。
- Ubuntu 24.04，Python 3.12.3。
- Fedora 44，Python 3.14.10。
- openSUSE Leap 16.0，Python 3.13.14。
- Arch Linux，验证当天为 Python 3.14.10。

代码只使用 Python 标准库，要求 Python 3.10 及以上，因此各系统自带的 Python 就是 Dibab 运行所用的 Python。

## 全新安装的输出

在没有任何配置时，`dibab --diagnose` 检查安装情况，并且不写入任何内容。在四个系统上，该命令都打印了同样的结果：五项检查通过，一项未配置，八项取决于配置，退出码为 0（试验会话使用英文；在中文系统上，同样的内容以中文显示）：

```text
OK python : 3.13.5
OK outil_pdftotext : /usr/bin/pdftotext
OK outil_pdftoppm : /usr/bin/pdftoppm
OK outil_findmnt : /usr/bin/findmnt
OK outil_ssh : /usr/bin/ssh
NON_CONFIGURÉ configuration : no configuration found (the --config option: not given; the DIBAB_CONFIG variable: not given; the XDG location: ~/.config/dibab/config.json; the script folder: /usr/lib/dibab/config.json)
NON_VÉRIFIÉ emplacement_etat : depends on the configuration
NON_VÉRIFIÉ ollama : depends on the configuration
NON_VÉRIFIÉ modele_ocr : depends on the configuration
NON_VÉRIFIÉ modele_tri_rapide : depends on the configuration
NON_VÉRIFIÉ modele_classification : depends on the configuration
NON_VÉRIFIÉ modele_tri_decision : depends on the configuration
NON_VÉRIFIÉ destination_personnel : depends on the configuration
NON_VÉRIFIÉ destination_professionnel : depends on the configuration
Diagnostic: 5 OK, 0 warning(s), 0 failure(s), 1 not configured, 8 not checked
```

第一行的 Python 版本是 Debian 13 的版本；您的是您系统的版本。写好配置之后，同一条命令会检查模型服务器、模型和每个保险库，手册中关于[诊断](https://dibab.davalan.fr/zh/documentation/index.md)的章节解释了每一行。

## 安装之后

根据软件包安装的示例创建配置（README，同一节），并阅读手册中关于配置和首次运行的章节，它们列在[文档页面](https://dibab.davalan.fr/zh/documentation/index.md)上。

