欢迎!本页面将引导您如何离线安装 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.
为了后续操作方便,我们首先重置系统的 root 用户密码。请根据提示输入新密码。
For convenience in subsequent operations, we'll first reset the root user password. Please enter your new password when prompted.
sudo passwd root
开启 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.
使用以下命令直接下载 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.
进入 /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
我们提供了修复后的 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.
在添加新的软件源之前,建议先清理 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
接下来,您需要将我们的 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.
添加软件源后,您需要更新 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.
完成上述所有准备工作后,您现在可以运行 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
---
如果您在安装 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:
检查网络连接: 确保您的设备在下载离线包、修复后的 Shell 文件或使用 APT 源时可以访问互联网。
Check Network Connection: Ensure your device has internet access when downloading the offline package, repaired shell file, or using the APT repository.
文件路径: 仔细检查您在各个步骤中使用的文件路径和文件名是否正确。
File Paths: Carefully verify that the file paths and names you used in each step are correct.
权限问题: 确保您有足够的权限执行命令(例如使用了 sudo)。
Permission Issues: Ensure you have sufficient permissions to execute commands (e.g., by using `sudo`).
解压错误: 检查解压过程是否成功,以及是否有足够的磁盘空间。
Unzipping Errors: Check if the unzipping process was successful and if there's enough disk space.
APT 源错误: 如果与 APT 源相关的问题,请确保您正确添加了源,并且没有出现 `NO_PUBKEY` 等与GPG签名相关的错误(尽管本源没有GPG签名)。
APT Source Errors: If the issue is related to the APT repository, ensure you've added the source correctly and there are no `NO_PUBKEY` or similar GPG signature-related errors (though this repository is unsigned).
安装失败: 如果执行安装后仍提示安装错误,请执行修复命令。
Installation failed: If an installation error is still displayed after the installation is completed, execute the repair command.
sudo apt install --fix-broken
如果问题依然存在,请记录下您遇到的具体错误信息和截图,并联系官方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.