Linux 和 ARM 服务器安装
针对某些 Linux 操作系统和 ARM 平台服务器安装的特殊情况。
The officially supported systems are Ubuntu 24.04, Ubuntu 22.04 and Debian 13 (see Server Installation). Older versions (Debian 12 or older, Ubuntu 20.04 or older) and ARM systems are not officially supported and are currently maintained by the community! 以下步骤尚在完善中,随时可能更改!
Linux Debian 12 (and older) Installation
请谨慎使用脚本和命令,风险自负!
如果你运行的是 Debian 12 或更早版本,请升级到 Debian 13 或将你的操作系统更改为至少 Ubuntu 22.04.1 LTS
这将修复以下类型的错误:version GLIBCXX 3.4.30 not found 或/和 version GLIBC 2.34 not found
由于 nanos world 使用 gcc 11,我们需要将我们的一个软件包升级到测试仓库。
使用脚本
你可以运行此脚本来安装所需的库,但请查看脚本代码以了解脚本将执行的操作。(务必以 root 身份运行!)
wget -O - https://raw.githubusercontent.com/Falaxir/nanos-world_yolks-game-panels/master/docker-oses/debian/fixglibcxx.sh | bash
手动
首先,更新你的 sources.list 文件(位于:/etc/apt/sources.list),你需要添加测试仓库源,你可以将以下几行添加到你的源中:
deb http://ftp.fr.debian.org/debian/ testing main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ testing main contrib non-free
之后,我们需要创建一个 preferences 文件,告诉我们的系统,除非另有指定,否则不要优先安装测试包而不是稳定包。在 /etc/apt/preferences 中(如果不存在则创建),添加以下几行:
Package: *
Pin: release a=stable
Pin-Priority: 900
Package: *
Pin: release a=testing
Pin-Priority: 400
现在,请使用以下命令更新服务器,确保系统能够找到测试仓库:
sudo apt update
我们将向服务器安装 libstdc++6 测试软件包,这将使服务器能够正确启动。你可以使用以下命令进行安装:
sudo apt-get --target-release testing install libstdc++6
大功告成!现在你可以继续进行下一步,配置你的 nanos world 服务器。
Linux Ubuntu 20
Ubuntu 20 没有最新的库,因此 nanos world 不支持此版本及更早版本的 Ubuntu 操作系统。
将服务器升级到 Ubuntu 22 比让 nanos world 服务器在 Ubuntu 20 上运行要容易得多
有很多类似这篇的指南,介绍了如何升级服务器的步骤。
Linux ARM(树莓派及其他)
实验性内容:使用风险自负!
Nanos world 服务器官方不支持 ARM 架构,但如果你真的非常非常希望服务器能在树莓派、RockPro64 等 Arm 平台上运行……那你就可以这样做!
本 ARM 指南已在较旧的 nanos world server 上进行过测试,部分功能可用(在 2022 年 11 月从 gcc 9 迁移到 gcc 11 之前),但可能已过时!
我们需要 2 个模拟器:
- 用于 Nanos World 服务器的 box64:https://github.com/ptitSeb/box64
- 用于 steam 的 box86:https://github.com/ptitSeb/box86
你必须在你的开发板上构建并安装这些模拟器。如果你不想使用 steamcmd 来下载和更新服务器,则 box86 是可选的
请仔细阅读模拟器仓库中的说明,命令会根据开发板的不同而有所差异。
示例:
- RK3399 适用于 Pine64、RockPro64、Orange Pi……
这些步骤已在 rockpro64 上的 Armbian Bullseye 64bits (aarch64) 系统上进行了测试。其他开发板和发行版可能需要一些额外的步骤
Box86
要安装它,只需按照此处的说明操作:https://github.com/ptitSeb/box86/blob/master/docs/COMPILE.md
如果出于某种原因,你的系统找不到 Box86 并且你使用的是 64 位操作系统,请运行以下命令:
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install libc6:armhf libncurses5:armhf libstdc++6:armhf
Box64
克隆仓库,然后我们需要替换 x64lib 文件夹内的文件 libstdc++.so.6。你将需要该文件的一个更新版本,其中至少包含 GLIBCXX v3.4.26。
You can grab it inside an updated Linux distro such as Ubuntu 22.04 or Debian 13.
要检查该文件是否至少包含 GLIBCXX v3.4.26,请使用此命令:
strings libstdc++.so.6 | grep LIBCXX
如果显示 GLIBCXX v3.4.26,你可以将此文件放入 x64lib 文件夹中。
你现在可以按照此处的其余说明进行操作(从 mkdir 步骤开始,因为你已经克隆了仓库):https://github.com/ptitSeb/box64/blob/main/docs/COMPILE.md
Steam 与服务器
你现在已经安装了模拟器,它们应该能够自动检测程序是否需要 x86_64/x86 模拟。
使用此命令在一个文件夹中手动获取 steamcmd:
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
你现在可以按照从 steamcmd 开始的 nanos world Linux 安装的基本说明进行操作(使用此命令运行 steamcmd:./steamcmd.sh)。
大功告成!现在你可以继续进行下一步,配置你的 nanos world 服务器。