PNETLAB-V6 离线安装指南与 APT 源使用
PNETLAB-V6 Offline Installation Guide & APT Repository Usage

欢迎!本页面将引导您如何离线安装 PNETLAB-V6,并解决在安装过程中可能遇到的常见问题。此外,我们还提供了APT源的使用指南。

Welcome! This page will guide you through the offline installation of PNETLAB-V6 and address common issues you might encounter during the process. Additionally, we provide guidance on using our APT repository.

安全警告: 本软件源未进行 GPG 签名验证。这意味着您的系统将不会验证从该源下载的软件包的真实性或完整性。请确保您完全信任此源的提供者,再继续操作。

Security Warning: This repository is not GPG signed. This means your system will not verify the authenticity or integrity of packages downloaded from this source. Please ensure you fully trust the provider of this source before proceeding.

重要提示:
1. 在执行任何系统修改之前,建议您备份重要数据。
2. 请确保您的系统可以访问互联网,以下步骤中需要下载离线包和修复文件。
3. 本APT源仅为解决用户安装PNETLAB-V6版本时无法安装php7.2模块时的问题。请谨慎使用。

Important Note:
1. Before performing any system modifications, it's recommended to back up your important data.
2. Please ensure your system has internet access, as the offline package and a repaired file need to be downloaded in the steps below.
3. This APT repository is solely for resolving issues where users cannot install the php7.2 module when installing PNETLAB-V6. Please use with caution.

PNETLAB-V6 离线安装步骤
PNETLAB-V6 Offline Installation Steps

步骤 1: 重置 Root 密码
Step 1: Reset Root Password

为了后续操作方便,我们首先重置系统的 root 用户密码。请根据提示输入新密码。

For convenience in subsequent operations, we'll first reset the root user password. Please enter your new password when prompted.

sudo passwd root

步骤 2: 开启 SSH 的 Root 登录权限
Step 2: Enable SSH Root Login

开启 SSH 的 root 登录权限,以便通过 SSH 更便捷地进行文件上传和操作。

Enable root login via SSH for easier file uploads and operations.

sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
sudo sed -i 's/^PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
sudo service ssh restart

执行上述命令后,SSH 服务会重启。

After executing the above commands, the SSH service will restart.


步骤 3: 下载 PNETLAB-V6 离线安装包
Step 3: Download PNETLAB-V6 Offline Installation Package

使用以下命令直接下载 PNETLAB-V6 离线安装包到系统的 /root/ 目录下:

Use the following command to directly download the PNETLAB-V6 offline installation package to the /root/ directory on your system:

cd /root/
sudo wget -O offline-pnetlab-v6.zip https://github.com/xuepudong/pnetlabv6lib/releases/download/v1.0.0/offline-pnetlab-v6.zip

请确保文件下载到 /root/ 目录。

Please ensure the file is downloaded to the /root/ directory.


步骤 4: 解压离线安装包
Step 4: Unzip the Offline Installation Package

进入 /root/ 目录,并解压下载好的离线安装包。

Navigate to the /root/ directory and unzip the downloaded offline installation package.

cd /root/
sudo apt update && sudo apt install unzip -y
sudo unzip offline-pnetlab-v6.zip

步骤 5: 下载并替换修复后的 Shell 文件
Step 5: Download and Replace the Repaired Shell File

我们提供了修复后的 install_pnetlab_v6.sh 文件,用于解决安装 php7.2 模块的问题。请下载并替换掉您离线包解压后的同名文件。

We provide a repaired install_pnetlab_v6.sh file to fix issues with installing the php7.2 module. Please download and replace the identically named file after unzipping your offline package.

cd /root/offline-6/
# 假设离线包解压后,install_pnetlab_v6.sh 文件位于 /root/offline-6/ 目录下
# Assuming after unzipping the offline package, install_pnetlab_v6.sh is in /root/offline-6/
sudo wget -O install_pnetlab_v6.sh https://raw.githubusercontent.com/xuepudong/pnetlabv6lib/refs/heads/master/install_pnetlab_v6.sh
sudo chmod +x install_pnetlab_v6.sh

注意: 如果您解压后的 install_pnetlab_v6.sh 文件不在 /root/ 目录下,请先 cd 到该文件所在的目录再执行 wget 命令,或者调整 wget -O 的路径。

Note: If the unzipped install_pnetlab_v6.sh file isn't in the /root/ directory, please `cd` into the file's directory before executing the `wget` command, or adjust the `wget -O` path.


步骤 6: 清理 APT 缓存
Step 6: Clean APT Cache

在添加新的软件源之前,建议先清理 APT 的本地缓存,以确保更新过程顺利。

Before adding a new repository, it's recommended to clean APT's local cache to ensure a smooth update process.

sudo apt clean all

步骤 7: 添加软件源到您的系统
Step 7: Add the Repository to Your System

接下来,您需要将我们的 APT 软件源信息添加到您的系统配置中。这会告诉您的系统从哪里获取软件包。

Next, you need to add our APT repository information to your system's configuration. This tells your system where to fetch packages from.

在终端中运行以下命令:

Run the following command in your terminal:

echo "deb [trusted=yes] https://xuepudong.github.io/pnetlabv6lib/ focal main" | sudo tee /etc/apt/sources.list.d/pnetlab.list

这个命令会在 /etc/apt/sources.list.d/ 目录下创建一个名为 pnetlab.list 的文件,并将软件源地址写入其中。

This command creates a file named pnetlab.list in the /etc/apt/sources.list.d/ directory and writes the repository address into it.

请注意其中的 [trusted=yes] 标记,它表示系统将信任此源,即使没有 GPG 签名。再次提醒您,这意味着您需要自行承担由此带来的安全风险。

Please note the [trusted=yes] flag, which indicates that the system will trust this source even without a GPG signature. We remind you again that this means you assume the associated security risks.


步骤 8: 更新软件包列表
Step 8: Update Package List

添加软件源后,您需要更新 APT 软件包列表,以便系统能够识别新添加的源中的软件包。

After adding the repository, you need to update the APT package list so your system recognizes the packages available from the newly added source.

sudo apt update

在执行此命令时,您可能会看到关于未签名源的警告信息,这是正常的。

When running this command, you might see warnings about unsigned sources, which is normal.


步骤 9: 运行安装脚本
Step 9: Run the Installation Script

完成上述所有准备工作后,您现在可以运行 install_pnetlab_v6.sh 脚本来开始 PNETLAB-V6 的安装过程了。请根据脚本提示完成安装。

After completing all the above preparations, you can now run the install_pnetlab_v6.sh script to begin the PNETLAB-V6 installation process. Please follow the script's prompts to complete the installation.

cd /root/offline-6 # 确保在脚本所在目录
# Ensure you are in the directory where the script is located
sudo ./install_pnetlab_v6.sh
---

遇到问题?
Troubleshooting?

如果您在安装 PNETLAB-V6 或使用 APT 源过程中遇到任何问题,请尝试以下常见故障排除步骤:

If you encounter any issues during the PNETLAB-V6 installation or when using the APT repository, please try the following common troubleshooting steps:

如果问题依然存在,请记录下您遇到的具体错误信息和截图,并联系官方TG并与Alex获取相关支持。

If the problem persists, please record the specific error message and screenshots you encountered, and contact the official Telegram and get relevant support from Alex.