mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-02-25 10:41:17 +00:00
6.2 KiB
6.2 KiB
icon |
---|
material/package |
包管理器
:material-tram: 仓库安装
=== ":material-debian: Debian / APT"
```bash
sudo curl -fsSL https://sing-box.app/gpg.key -o /etc/apt/keyrings/sagernet.asc
sudo chmod a+r /etc/apt/keyrings/sagernet.asc
echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/sagernet.asc] https://deb.sagernet.org/ * *" | \
sudo tee /etc/apt/sources.list.d/sagernet.list > /dev/null
sudo apt-get update
sudo apt-get install sing-box # or sing-box-beta
```
=== ":material-redhat: Redhat / DNF"
```bash
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://sing-box.app/sing-box.repo
sudo dnf install sing-box # or sing-box-beta
```
=== ":material-redhat: CentOS / YUM"
```bash
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://sing-box.app/sing-box.repo
sudo yum install sing-box # or sing-box-beta
```
:material-download-box: 手动安装
=== ":material-debian: Debian / DEB"
```bash
bash <(curl -fsSL https://sing-box.app/deb-install.sh)
```
=== ":material-redhat: Redhat / RPM"
```bash
bash <(curl -fsSL https://sing-box.app/rpm-install.sh)
```
=== ":simple-archlinux: Archlinux / PKG"
```bash
bash <(curl -fsSL https://sing-box.app/arch-install.sh)
```
:material-book-lock-open: 托管安装
=== ":material-linux: Linux"
| 类型 | 平台 | 链接 | 命令 |
|----------|---------------|------------------------------|---------------------------------------------------------------------------------------------------------------|
| AUR | Arch Linux | `? -S sing-box` | [][aur] |
| nixpkgs | NixOS | `nix-env -iA nixos.sing-box` | [][nixpkgs] |
| Homebrew | macOS / Linux | `brew install sing-box` | [][brew] |
| APK | Alpine | `apk add sing-box` | [][alpine] |
=== ":material-apple: macOS"
| 类型 | 平台 | 链接 | 命令 |
|----------|-------|-------------------------|------------------------------------------------------------------------------------------------|
| Homebrew | macOS | `brew install sing-box` | [][brew] |
=== ":material-microsoft-windows: Windows"
| 类型 | 平台 | 链接 | 命令 |
|------------|---------|---------------------------|-----------------------------------------------------------------------------------------------------|
| Scoop | Windows | `scoop install sing-box` | [][scoop] |
| Chocolatey | Windows | `choco install sing-box` | [][choco] |
| winget | Windows | `winget install sing-box` | [][winget] |
=== ":material-android: Android"
| 类型 | 平台 | 链接 | 命令 |
|--------|---------|--------------------|----------------------------------------------------------------------------------------------|
| Termux | Android | `pkg add sing-box` | [][termux] |
=== ":material-freebsd: FreeBSD"
| 类型 | 平台 | 链接 | 命令 |
|------------|---------|------------------------|--------------------------------------------------------------------------------------------|
| FreshPorts | FreeBSD | `pkg install sing-box` | [][ports] |
:material-book-multiple: 服务管理
对于带有 systemd 的 Linux 系统,通常安装已经包含 sing-box 服务, 您可以使用以下命令管理服务:
行动 | 命令 |
---|---|
启用 | sudo systemctl enable sing-box |
禁用 | sudo systemctl disable sing-box |
启动 | sudo systemctl start sing-box |
停止 | sudo systemctl stop sing-box |
强行停止 | sudo systemctl kill sing-box |
重新启动 | sudo systemctl restart sing-box |
查看日志 | sudo journalctl -u sing-box --output cat -e |
实时日志 | sudo journalctl -u sing-box --output cat -f |