EVE-NG 5.1懒人版升级6.2.0-4社区版避坑 更新 重要提示
本帖最后由 JackLudens 于 2025-4-11 20:59 编辑<h1>EVE-NG懒人版升级避坑 更新 重要提示</h1>
<p>EVE-NG 懒人版从 <strong>5.0.1-13</strong> 升级 <strong>6.2.0-4</strong>,一些避坑提示<br />
楼主也是走了一些弯路,现在更新一下帖子</p>
<hr />
<h2>升级前准备</h2>
<ol>
<li><strong>快照备份</strong><br />
升级前请先将 EVE VM 虚拟机关机,并做个快照,以免升级后出现异常而无法恢复。</li>
</ol>
<hr />
<h2>更新重要提示:</h2>
<p><strong>论坛里很多朋友在升级时遇到相同的错误</strong></p>
<p><strong>原因是替换软件源时,将eve-ng源放在了第一行</strong><br />
<br></p>
<h2>替换源时,要将eve-ng源放在最后一行!!!</h2>
<p>否则会出现以下错误</p>
<pre><code>authenticate 'jammy.tar.gz' against 'jammy.tar.gz.gpg'
Authentication failed
Authenticating the upgrade failed. There may be a problem with the network or with the server.
Upgrade REJECT !!!!!
dist upgrade failed
check /var/log/distupgrade log files for details
</code></pre>
<p><strong>eve升级脚本会尝试升级Ubuntu到22.04,将eve-ng的源放在第一行会导致升级失败,脚本直接停止运行,由于脚本运行时会先删除大量软件包,如果脚本出现此错误运行失败,会导致eve-ng包被删除,脚本无法再次运行</strong><br />
<br><br />
<strong>建议在成功升级eve-ng到5.0.1-24版本后,将虚拟机关机,并保存快照</strong><br />
<br><br />
<br><br />
<br></p>
<h2>官方升级</h2>
<h2>替换 apt 源</h2>
<ol>
<li>
<p><strong>替换原因</strong><br />
默认情况下,懒人版的 apt 源为华为源,需要替换成官方源。</p>
</li>
<li>
<p><strong>挂代理注意事项</strong></p>
<ul>
<li>
<p>如果升级速度较慢,请考虑挂代理。</p>
</li>
<li>
<p>如果使用的是香港代理,请将 apt 源替换成香港的官方源。</p>
<p>示例(Ubuntu 20.04 LTS 香港官方源):</p>
</li>
</ul>
<pre><code class="language-bash"># Ubuntu 20.04 LTS 香港官方主源
deb http://hk.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
# Ubuntu 20.04 LTS 香港更新源
deb http://hk.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
# Ubuntu 20.04 LTS 香港安全更新源
deb http://hk.archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
# Ubuntu 20.04 LTS 香港回溯更新源
deb http://hk.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
</code></pre>
<br>
</li>
<li>
<p><strong>海外用户注意</strong><br />
如果人在海外,请替换成当地的官方源或其他延迟低、下载速度快的官方源。</p>
</li>
<li>
<p><strong>重要提示</strong><br />
在替换 apt 源时,不要注释或删除 <code>/etc/apt/sources.list</code> 中的以下内容:</p>
<pre><code class="language-bash">deb http://eve-ng.net/focal focal main
</code></pre>
</li>
</ol>
<hr />
<h2>执行更新和升级命令</h2>
<p>在完成换源后,依次执行以下命令:</p>
<pre><code class="language-bash">apt update
apt upgrade
apt dist-upgrade
apt autoremove
reboot
</code></pre>
<h2>升级过程中可能遇到的提示</h2>
<p>在执行 <code>apt upgrade</code> 时,可能会出现如下提示:</p>
<pre><code class="language-bash">Configuration file `/etc/issue'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ?Your options are:
Y or I: install the package maintainer's version
N or O: keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** issue (Y/I/N/O/D/Z) ?
</code></pre>
<p>此时直接按回车即可。</p>
<h2>升级后的验证</h2>
<p>重启完成后,执行以下命令查看 EVE-NG 的版本:</p>
<pre><code class="language-bash">dpkg -l eve-ng
</code></pre>
<p>如果一切顺利,输出应类似如下(重点确认版本号为 <strong>5.0.1-24</strong>):</p>
<pre><code class="language-bash">root@eve-ce5:~# dpkg -l eve-ng
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trigpend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-==============================================
iieve-ng 5.0.1-24 amd64 A new generation software for networking labs.
root@eve-ce5:~#
</code></pre>
<p>请确认 <strong>eve-ng 版本为 5.0.1-24</strong>。建议在此处再次创建快照,因为升级脚本会先删除大量软件包,若运行升级脚本出现问题,可以利用快照快速恢复到升级前状态。</p>
<h2>执行升级脚本</h2>
<p>运行以下命令执行升级脚本:</p>
<pre><code class="language-bash">wget -O - http://www.eve-ng.net/jammy/update-eve-ce.sh > /tmp/update-eve-ce.sh && chmod +x /tmp/update-eve-ce.sh && /tmp/update-eve-ce.sh
</code></pre>
<br>
<br>
<br>
<br>
<h2>楼主的野路子升级法</h2>
<h2>替换更新源时要将EVE-NG的源放在最后一行!!!</h2>
<p><strong>若无法挂代理,直升又比较慢,可以尝试以下方法</strong></p>
<br>
<p>更换更新源为清华大学镜像源</p>
<pre><code class="language-bash">deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
</code></pre>
<p>在完成换源后,依次执行以下命令:</p>
<pre><code class="language-bash">apt update
apt upgrade
apt dist-upgrade
apt autoremove
reboot
</code></pre>
<p><strong>之后运行以下升级脚本</strong></p>
<pre><code>wget -O - http://www.eve-ng.net/jammy/update-eve-ce.sh | sed "s#grep -v 'eve-ng.net\\|ubuntu.com'#grep -v 'eve-ng.net\\|ubuntu.com\\|mirrors.tuna.tsinghua.edu.cn'#g" > /tmp/update-eve-ce.sh && chmod +x /tmp/update-eve-ce.sh && /tmp/update-eve-ce.sh
</code></pre>
<p><strong>该命令将清华源加入脚本白名单,使脚本可以使用清华源运行。</strong></p>
<p><strong>各地区网络状态不同,可以选择合适自己地区和运营商的源</strong><br />
<br><br />
只需要修改命令中添加源地址到脚本白名单的语句即可</p>
<pre><code>sed "s#grep -v 'eve-ng.net\\|ubuntu.com'#grep -v 'eve-ng.net\\|ubuntu.com\\|mirrors.tuna.tsinghua.edu.cn'#g"
</code></pre>
<br>
<p>将其中的</p>
<pre><code>mirrors.tuna.tsinghua.edu.cn
</code></pre>
<p>替换为任意软件源网址即可</p>
<p>可以使用阿里云镜像源,中国科学技术大学(USTC)镜像源,清华大学镜像源等。</p>
<p>请根据自己的网络情况自行选择。<br />
<br><br />
<br></p>
<h2>若遇到升级后设备无法启动的问题</h2>
<p>执行以下命令</p>
<pre><code>apt install --reinstall eve-ng
</code></pre>
<p>重启虚拟机后,设备即可正常启动</p>
<h2>关于第三方镜像导出配置问题</h2>
<p><strong>移动</strong>位于/opt/unetlab/scripts/下</p>
<pre><code>config_h3c.py
config_hillstone.py
config_ruijie.py
</code></pre>
<p>至</p>
<pre><code>/opt/unetlab/config_scripts/
</code></pre>
<h2>将华为usg6kv 华为ar1000v的console字段替换为telnet</h2>
<p><strong>Intel CPU目录:</strong></p>
<pre><code>/opt/unetlab/html/templates/intel
</code></pre>
<p><strong>AMD CPU目录:</strong></p>
<pre><code class="language-**">/opt/unetlab/html/templates/amd
</code></pre>
<p>修改该目录下,<strong>huaweiar1k.yml</strong>,<strong>huaweiusg6kv.yml</strong>的<strong>console</strong>字段</p>
<p>将</p>
<pre><code>console: vnc
</code></pre>
<p>修改为</p>
<pre><code>console: telnet
</code></pre>
<p>感谢帮助</p>
<p>从5.1懒人版升级遇到与你相同的错误,换了源,开了vpn后更新,就成功升级了。</p>
<p>谢谢</p>
感谢帮助! rill 发表于 2025-4-6 21:43
感谢帮助
从5.1懒人版升级遇到与你相同的错误,换了源,开了vpn后更新,就成功升级了。
谢谢
是的,使用延迟高或网络状态不佳的源或代理就可能会出现该问题,升级成功后可以看一下后面的部分,修改一下华为部分设备的console和第三方配置导出脚本相关的问题,懒人版升级会出现这些问题,需要手动修改一下 谢谢楼主分享! <p>升级不成功,正下载官方镜像准备安装</p>
xxgl2005 发表于 2025-4-8 15:59
升级不成功,正下载官方镜像准备安装
出现什么错误提示? JackLudens 发表于 2025-4-9 10:15
出现什么错误提示?
authenticate 'jammy.tar.gz' against 'jammy.tar.gz.gpg'
Authentication failed
Authenticating the upgrade failed. There may be a problem with the network or with the server.
Upgrade REJECT !!!!!
dist upgrade failed
check /var/log/distupgrade log files for details
换了几个源都是这个错误,彻底放弃了,新版的也已经安装好了,并且汉化了,现在正上传镜像 <p><img src="data/attachment/forum/202504/09/110102bxyvh7yxfdz9h3ff.png" alt="image.png" title="image.png" /></p>
<p>安装也挺快的,就是上传镜像稍微有点慢了</p>
xxgl2005 发表于 2025-4-9 10:59
authenticate 'jammy.tar.gz' against 'jammy.tar.gz.gpg'
Authentication failed
Authenticating the u ...
提示这个就是网络问题,也可能跟代理有关,直装也不错,就是导入镜像有点麻烦