<!-- review: finished -->

<a id="oss-packages"></a>

# Angie 软件包安装

要使用您的发行版软件包管理器
安装和更新 Angie,
请添加并配置相应的仓库。

<a id="distributions"></a>

## 发行版

| 名称                                | 版本                             | 架构                            |
|-----------------------------------|--------------------------------|-------------------------------|
| [AlmaLinux](#install-yum-oss)     | 10,  9,  8                     | x86-64, arm64                 |
| [Alpine](#install-alpine-oss)     | 3.23,  3.22,  3.21,  3.20      | x86-64, arm64                 |
| [Alt](#install-alt-oss)           | 11,  10  8                     | x86-64, arm64  x86-64         |
| [Astra SE](#install-astrase-oss)  | 4.7  1.8, 1.7                  | arm64  x86-64                 |
| [CentOS](#install-yum-oss)        | 10,  9                         | x86-64, arm64                 |
| [Debian](#install-deb-oss)        | 13,  12,  11                   | x86-64, arm64                 |
| [Fedora](#install-yum-oss)        | 44,  43                        | x86-64, arm64                 |
| [FreeBSD](#install-freebsd-oss)   | 15,  14,  13                   | x86-64, arm64                 |
| [MSVSphere](#install-yum-oss)     | 10,  9  8                      | x86-64, arm64  x86-64         |
| [openSUSE](#install-opensuse-oss) | 16,  15                        | x86-64, arm64                 |
| [Oracle Linux](#install-yum-oss)  | 10,  9,  8                     | x86-64, arm64                 |
| [OSNova](#install-osnova-oss)     | 3.3.0,  2.13                   | x86-64                        |
| [RED OS](#install-yum-oss)        | 8,  7                          | x86-64, arm64                 |
| [Rocky Linux](#install-yum-oss)   | 10,  9,  8                     | x86-64, arm64                 |
| [ROSA](#install-yum-oss)          | Chrome 13  Chrome 12  Fresh 12 | x86-64  x86-64, arm64  x86-64 |
| [SberLinux](#install-yum-oss)     | 9                              | x86-64                        |
| [Ubuntu](#install-deb-oss)        | 26.04,  24.04,  22.04          | x86-64, arm64                 |

<a id="test-builds"></a>

### 测试构建

我们每天测试并构建来自我们仓库的代码,
这些
[每日构建](https://download.angie.software/angie-nightly/)
适合在正式发布之前探索新功能。

每日构建的版本始终对应于即将发布的版本。
命名和安装过程通常与下面显示的类似,
但不使用路径前缀 `https://download.angie.software/angie/*`,
而是使用 `https://download.angie.software/angie-nightly/*`。

<a id="install-yum-oss"></a>

### Alma、CentOS、Fedora、MSVSphere、Oracle、RED OS、Rocky、ROSA、SberLinux

1. 要添加仓库,请创建一个名为
   `/etc/yum.repos.d/angie.repo`
   的文件,内容如下:

   Alma
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/almalinux/$releasever/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   ```

   CentOS
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/centos/$releasever/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   ```

   Fedora
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/fedora/$releasever/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   ```

   MSVSphere
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/msvsphere/$releasever/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   ```

   Oracle
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/oracle/$releasever/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   ```

   RED OS
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/redos/$releasever/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   ```

   Rocky
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/rocky/$releasever/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   ```

   ROSA Chrome
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/rosa-chrome/$releasever/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   priority=9
   ```

   ROSA Fresh
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/rosa/$releasever/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   priority=9
   ```

   SberLinux
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/sberlinux/$releasever/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   priority=9
   ```
2. 安装 Angie 软件包:
   ```console
   $ sudo yum install -y angie
   $ # -- 或者 --
   $ sudo dnf install -y angie
   ```
3. ( *可选*) 安装您需要的任何 [额外](#install-extras-oss)
   软件包:
   ```console
   $ sudo yum install -y <PACKAGE NAME>
   $ # -- 或者 --
   $ sudo dnf install -y <PACKAGE NAME>
   ```
4. 启动服务:
   ```console
   $ sudo systemctl start angie
   ```
5. 要在服务器重启后自动启动 Angie:
   ```console
   $ sudo systemctl enable angie
   ```

<a id="install-alpine-oss"></a>

### Alpine

1. 安装添加 Angie 仓库的
   先决条件:
   ```console
   $ sudo apk update
   $ sudo apk add curl ca-certificates
   ```
2. 下载 Angie 仓库的公钥
   用于软件包验证:
   ```console
   $ sudo curl -o /etc/apk/keys/angie-signing.rsa \
               https://angie.software/keys/angie-signing.rsa
   ```
3. 添加 Angie 仓库:
   ```console
   $ echo "https://download.angie.software/angie/alpine/v$(egrep -o \
          '[0-9]+\.[0-9]+' /etc/alpine-release)/main" \
          | sudo tee -a /etc/apk/repositories > /dev/null
   ```
4. 更新仓库索引:
   ```console
   $ sudo apk update
   ```
5. 安装 Angie 软件包:
   ```console
   $ sudo apk add angie
   ```
6. ( *可选*) 安装您需要的任何 [额外](#install-extras-oss)
   软件包:
   ```console
   $ sudo apk add <PACKAGE NAME>
   ```
7. 启动服务:
   ```console
   $ sudo service angie start
   ```
8. 要在服务器重启后自动启动 Angie:
   ```console
   $ sudo rc-update add angie
   ```

<a id="install-alt-oss"></a>

### Alt

1. 创建 `/etc/ssl/angie/` 目录:
   ```console
   $ sudo mkdir -p /etc/ssl/angie/
   ```
2. 安装添加 Angie 仓库的
   先决条件:
   ```console
   $ sudo apt-get update
   $ sudo apt-get install -y curl apt-https
   ```
3. 下载 Angie 仓库的公钥
   用于软件包验证:
   ```console
   $ sudo curl -o /etc/ssl/angie/angie-signing.gpg \
         https://angie.software/keys/angie-signing.gpg
   ```
4. 将下载的密钥导入到受信任的密钥环:
   ```console
   $ sudo gpg --no-default-keyring \
         --keyring /usr/lib/alt-gpgkeys/pubring.gpg --import /etc/ssl/angie/angie-signing.gpg
   ```
5. 保存密钥的签名:
   ```sh
   $ echo 'simple-key "angie" {
             Fingerprint "EB8EAF3D4EF1B1ECF34865A2617AB978CB849A76";
             Name "Angie (Signing Key) <devops@tech.wbsrv.ru>";
     }' | sudo tee /etc/apt/vendors.list.d/angie.list > /dev/null
   ```
6. 添加 Angie 仓库:

   Alt 11
   ```console
   $ echo "rpm [angie] https://download.angie.software/angie/altlinux/11/ $(uname -m) main" \
       | sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
   ```

   Alt 10
   ```console
   $ echo "rpm [angie] https://download.angie.software/angie/altlinux/10/ $(uname -m) main" \
       | sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
   ```

   Alt SP 10
   ```console
   $ echo "rpm [angie] https://download.angie.software/angie/altlinux-sp/10/ $(uname -m) main" \
       | sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
   ```

   Alt SP 8
   ```console
   $ echo "rpm [angie] https://download.angie.software/angie/altlinux-sp/8/ $(uname -m) main" \
       | sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
   ```
7. 更新仓库索引:
   ```console
   $ sudo apt-get update
   ```
8. 安装 Angie 软件包:
   ```console
   $ sudo apt-get install -y angie
   ```
9. ( *可选*) 安装您需要的任何 [额外](#install-extras-oss)
   软件包:
   ```console
   $ sudo apt-get install -y <PACKAGE NAME>
   ```
10. 启动服务:
    ```console
    $ sudo systemctl start angie
    ```
11. 要在服务器重启后自动启动 Angie:
    ```console
    $ sudo systemctl enable angie
    ```

<a id="install-astrase-oss"></a>

### Astra SE

1. 安装添加 Angie 仓库所需的前置软件包:
   ```console
   $ sudo apt-get update
   $ sudo apt-get install -y ca-certificates curl lsb-release
   ```
2. 下载 Angie 仓库的公钥用于软件包验证:
   ```console
   $ sudo curl -o /etc/apt/trusted.gpg.d/angie-signing.gpg \
               https://angie.software/keys/angie-signing.gpg
   ```
3. 添加 Angie 仓库:
   ```console
   $ echo "deb https://download.angie.software/angie/astra-se/$(egrep -o \
          '[0-9]+.[0-9]+' /etc/astra_version) unstable main" \
          | sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
   ```
4. 更新仓库索引:
   ```console
   $ sudo apt-get update
   ```
5. ( *可选*) 当运行封闭软件环境 ([CSE](https://wiki.astralinux.ru/pages/viewpage.action?pageId=41190634)) 时,
   安装用于 Angie 二进制文件验证的密钥软件包:
   ```console
   $ sudo apt-get install -y angie-digsig-key
   ```

   更新 CSE:
   ```console
   $ sudo update-initramfs -uk all
   ```

   然后 **重启服务器**:
   ```console
   $ sudo shutdown -r now
   ```
6. 安装 Angie 软件包:
   ```console
   $ sudo apt-get install -y angie
   ```
7. ( *可选*) 安装您需要的任何 [额外](#install-extras-oss) 软件包:
   ```console
   $ sudo apt-get install -y <PACKAGE NAME>
   ```

<a id="install-deb-oss"></a>

### Debian, Ubuntu

1. 安装添加 Angie 仓库所需的前置软件包:
   ```console
   $ sudo apt-get update
   $ sudo apt-get install -y ca-certificates curl
   ```
2. 下载 Angie 仓库的公钥用于软件包验证:
   ```console
   $ sudo curl -o /etc/apt/trusted.gpg.d/angie-signing.gpg \
               https://angie.software/keys/angie-signing.gpg
   ```
3. 添加 Angie 仓库:
   ```console
   $ echo "deb https://download.angie.software/angie/$(. /etc/os-release && echo "$ID/$VERSION_ID $VERSION_CODENAME") main" \
       | sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
   ```
4. 更新仓库索引:
   ```console
   $ sudo apt-get update
   ```
5. 安装 Angie 软件包:
   ```console
   $ sudo apt-get install -y angie
   ```
6. ( *可选*) 安装您需要的任何 [额外](#install-extras-oss) 软件包:
   ```console
   $ sudo apt-get install -y <PACKAGE NAME>
   ```

<a id="install-osnova-oss"></a>

### OSNova

1. 安装添加 Angie 仓库所需的前置软件包:
   ```console
   $ sudo apt-get update
   $ sudo apt-get install -y ca-certificates curl
   ```
2. 下载 Angie 仓库的公钥用于软件包验证:
   ```console
   $ sudo curl -o /etc/apt/trusted.gpg.d/angie-signing.gpg \
               https://angie.software/keys/angie-signing.gpg
   ```
3. 添加 Angie 仓库:
   ```console
   $ echo "deb https://download.angie.software/angie/osnova/$(egrep -o \
          '[0-9]*' /etc/osnova_version | head -1) \
          $(. /etc/os-release && echo "$VERSION_CODENAME") main" \
          | sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
   ```
4. 更新仓库索引:
   ```console
   $ sudo apt-get update
   ```
5. 安装 Angie 软件包:
   ```console
   $ sudo apt-get install -y angie
   ```
6. ( *可选*) 安装您需要的任何 [额外](#install-extras-oss) 软件包:
   ```console
   $ sudo apt-get install -y <PACKAGE NAME>
   ```

<a id="install-freebsd-oss"></a>

### FreeBSD

1. 要添加 Angie 仓库,请创建目录:
   ```console
   $ sudo mkdir -p /usr/local/etc/pkg/angie/ /usr/local/etc/pkg/repos/
   ```
2. 要配置仓库,请创建名为 `/usr/local/etc/pkg/repos/angie.conf` 的文件,
   内容如下:
   ```console
   angie: {
      url: "https://download.angie.software/angie/freebsd/${VERSION_MAJOR}/${ARCH}",
      signature_type: "pubkey",
      pubkey: "/usr/local/etc/pkg/angie/angie-signing.rsa",
      enabled: yes
   }
   ```
3. 下载 Angie 仓库的公钥用于软件包验证:
   ```console
   $ sudo curl -o /usr/local/etc/pkg/angie/angie-signing.rsa \
               https://angie.software/keys/angie-signing.rsa
   ```
4. 更新仓库索引:
   ```console
   $ sudo pkg update
   ```
5. 安装 Angie 软件包:
   ```console
   $ sudo pkg install -r angie -y angie
   ```
6. ( *可选*) 安装您需要的任何 [额外](#install-extras-oss) 软件包:
   ```console
   $ sudo pkg install -r angie -y <PACKAGE NAME>
   ```
7. 启动服务:
   ```console
   $ sudo service angie start
   ```
8. 设置服务器重启后自动启动 Angie:
   ```console
   $ sudo sysrc angie_enable=YES
   ```

#### NOTE
由于 FreeBSD 软件包管理器可能无法正确确定最新版本,
请使用以下方法更新已安装的软件包:

```console
$ sudo pkg upgrade `pkg search -r angie angie-[0-9] | sort -Vr | head -1 | awk {'print $1'}`
```

<a id="install-opensuse-oss"></a>

### openSUSE

1. 要添加仓库,请创建名为 `/etc/zypp/repos.d/angie.repo` 的文件,
   内容如下:
   ```ini
   [angie]
   name=Angie repo
   baseurl=https://download.angie.software/angie/opensuse/$releasever_major/
   gpgcheck=1
   enabled=1
   gpgkey=https://angie.software/keys/angie-signing.gpg.asc
   ```
2. 更新仓库索引:
   ```console
   $ sudo zypper refresh
   ```
3. 安装 Angie 软件包:
   ```console
   $ sudo zypper install -y angie
   ```
4. ( *可选*) 安装您需要的任何 [额外](#install-extras-oss) 软件包:
   ```console
   $ sudo zypper install -y <PACKAGE NAME>
   ```
5. 启动服务:
   ```console
   $ sudo systemctl start angie
   ```
6. 设置服务器重启后自动启动 Angie:
   ```console
   $ sudo systemctl enable angie
   ```

<a id="install-extras-oss"></a>

## 额外软件包

除了提供基本功能的软件包外,
我们还发布了一些额外的软件包,
包括我们自己的软件包和从精选的第三方源构建的软件包。

<a id="install-console-light-oss"></a>

### Console Light 网页面板

Console Light 是一个用于 Angie 的轻量级网页监控面板,
在我们的仓库中以 `angie-console-light` 发布。
它的安装方式与上述步骤中的 `angie` 软件包相同;
配置步骤请参见 [Console Light Web 监控面板](https://cn.angie.software//angie/docs/configuration/monitoring.md#monitoring)。

<a id="install-dynamicmodules-oss"></a>

### 动态模块

为了扩展 Angie 的基本功能,
您可以添加各种动态模块。
模块可以针对相应版本的 Angie [从源代码构建](https://cn.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild),
但从我们的仓库获取现成的软件包会更容易:

| [angie-module-image-filter](https://cn.angie.software//angie/docs/configuration/modules/http/http_image_filter.md#http-image-filter)                                                                                                     | 为 JPEG、GIF、PNG 和 WebP 图像添加转换功能。                                                                             |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| angie-module-njs:<br/>[JS](https://cn.angie.software//angie/docs/installation/external-modules/http_js.md#http-js) (HTTP),<br/>[JS](https://cn.angie.software//angie/docs/installation/external-modules/stream_js.md#stream-js) (stream) | 允许在 Angie 配置中分别在 `http` 和 `stream` 上下文中<br/>使用 njs(JavaScript 子集)。                                          |
| [angie-module-perl](https://cn.angie.software//angie/docs/configuration/modules/http/http_perl.md#http-perl)                                                                                                                             | 允许使用 Perl 编写 `location` 和变量处理程序,<br/>以及从 SSI 调用 Perl。                                                       |
| [angie-module-wamr](https://cn.angie.software//angie/docs/configuration/modules/wasm/wasm_wamr.md#wasm-wamr)                                                                                                                             | 启用与 [WebAssembly Micro Runtime](https://github.com/bytecodealliance/wasm-micro-runtime)<br/>的集成以执行 WASM 代码。 |
| [angie-module-wasm](https://cn.angie.software//angie/docs/configuration/modules/wasm/index.md#wasm-core)                                                                                                                                 | 添加核心 WASM 支持。                                                                                               |
| [angie-module-wasmtime](https://cn.angie.software//angie/docs/configuration/modules/wasm/wasm_wasmtime.md#wasm-wasmtime)                                                                                                                 | 启用与 [Wasmtime](https://wasmtime.dev/)<br/>运行时的集成以执行 WASM 代码。                                                |
| [angie-module-xslt](https://cn.angie.software//angie/docs/configuration/modules/http/http_xslt.md#http-xslt)                                                                                                                             | 添加过滤器以使用 XSLT 样式表转换 XML 响应。                                                                                 |

要在 [配置](https://cn.angie.software//angie/docs/configuration/configfile.md#configfile) 中使用已安装的模块,
请在 `main` 上下文中使用 [load_module](https://cn.angie.software//angie/docs/configuration/modules/core.md#load-module) 指令加载它:

```nginx
load_module modules/<module name>.so;
```

还有大量的 [第三方模块](https://cn.angie.software//angie/docs/installation/external-modules/index.md#install-thirdpartymodules) 可用。
