恨难穷 發表於 2021-4-25 21:50:00

「Debian」- 操作系统升级(通用方法) @20210425

<div id="content-wrap">
<h2>问题描述</h2>
<p>我们需要升级操作系统,升级 Debian 8.3 到 Debian 9.13 版本,后来我们又升级到 Debian 10 版本。</p>
<p>该文档将记录:我们升级 Debian 8.3 到 Debian 9.13 到 Debian 10 版本的过程,并展示出通用的升级方法。</p>
<h2>注意事项</h2>
<p> 1)在升级前,请先进行数据备份,防止系统升级失败或其他原因,而带来损失;<br> 2)如果没有必要,不建议升级操作系统;<br> 3)需要注意的事项及经验教训,参考 Experience of Software Upgrades 笔记; </p>
<h2>解决方案</h2>
<p> 对于跨版本升级,需要逐步进行。 </p>
<h3>第一步、Debian 8.3 =&gt; Debian 9.13</h3>
<div class="zim-object">
<pre># 更新系统,以使其为当前版本最新
apt-get update
apt-get upgrade
apt-get dist-upgrade
reboot

# 设置新的软件源
cat &gt; /etc/apt/sources.list.d/debian-9.list
deb http://mirrors.tencentyun.com/debian stretch main contrib non-free
deb http://mirrors.tencentyun.com/debian stretch-updates main contrib non-free
deb http://mirrors.tencentyun.com/debian-security stretch/updates main
EOF

# 更新系统,以更新到新版本
apt-get update
apt-get upgrade
apt-get dist-upgrade
reboot

# 验证升级成功
lsb_release -d
</pre>
</div>
<h3>第二步、Debian 9.13 =&gt; Debian 10</h3>
<div class="zim-object">
<pre># 更新系统,以使其为当前版本最新
apt-get update
apt-get upgrade
apt-get dist-upgrade
reboot

# 设置新的软件源
cat &gt; /etc/apt/sources.list.d/debian-10.list
deb http://mirrors.tencentyun.com/debian buster main contrib non-free
deb http://mirrors.tencentyun.com/debian buster-updates main contrib non-free
deb http://mirrors.tencentyun.com/debian-security buster/updates main
EOF

# 更新系统,以更新到新版本
apt-get update
apt-get upgrade
apt-get dist-upgrade
reboot

# 验证升级成功
lsb_release -d
</pre>
</div>
<h3>注意事项</h3>
<p>我们使用 mirrors.tencentyun.com 站点是因为我们的主机在腾讯云中,这里需要按需调整。如下为官方仓库:</p>
<div class="zim-object">
<pre>deb http://httpredir.debian.org/debian stretch main contrib non-free
deb http://httpredir.debian.org/debian stretch-updates main contrib non-free
deb http://security.debian.org stretch/updates main contrib non-free
</pre>
</div>
<p>在升级过程中,总会遇到各种问题,需要根据实际情况处理。如果不能承担风险,或者处理突发问题存在困难,则不建议升级。</p>
<h2>参考文献</h2>
<p> How to Upgrade Debian 8 Jessie to Debian Linux 9 Stretch {safely}<br> How to upgrade Debian 9 to Debian 10 Buster using the CLI - nixCrafts </p>

<br>
</div><br><br>
来源:https://www.cnblogs.com/k4nz/p/14702270.html
頁: [1]
查看完整版本: 「Debian」- 操作系统升级(通用方法) @20210425