Ubuntu 发行版升级

方法适用于 Ubuntu 发行版的更新/升级,例如 Ubuntu 18.04 升级到 20.04。

步骤

  1. 升级前需要先更新所有软件包
sudo apt update && sudo apt dist-upgrade
  1. 确保系统中安装了 update-manager-core 软件包
sudo apt install update-manager-core
  1. 开始升级,根据提示一路 y 或者回车就可以了
sudo do-release-upgrade

常见问题

  1. 升级 ssh 连接的服务器时会出现以下提示,建议记录一下启动的额外的 ssh 端口以防当前 ssh 连接中断。
Continue running under SSH? 

This session appears to be running under ssh. It is not recommended 
to perform a upgrade over ssh currently because in case of failure it 
is harder to recover. 

If you continue, an additional ssh daemon will be started at port 
'1022'. 
Do you want to continue? 

Continue [yN]y

Starting additional sshd 

To make recovery in case of failure easier, an additional sshd will 
be started on port '1022'. If anything goes wrong with the running 
ssh you can still connect to the additional one. 


To continue please press [ENTER]
  1. 部分需要输入的地方可能出现 Backspace 无法删除的字符,例如 ^[[D^[[C^[[A^[[C^H 等,可以通过 Ctrl+Backspace 删掉。
  2. 升级会干掉一些 sources.list 中的第三方源,升级之后不要忘记修改一下,原文如下:
Third party sources disabled 

Some third party entries in your sources.list were disabled. You can 
re-enable them after the upgrade with the 'software-properties' tool 
or your package manager. 

To continue please press [ENTER]

你可能感兴趣的:(Linux,ubuntu,linux)