Loading... > 从2021年4月起,Ubuntu16.04便不再更新,这导致一些软件包也可能不再更新,也许会影响到开发过程,因此应该尽早把系统版本升级。 ### 1、升级步骤 #### 1.1 更新已安装的软件 ```shell sudo apt-get update sudo apt-get upgrade -y sudo apt-get dist-upgrade ``` #### 1.2 移除不需要的软件 ```shell sudo apt-get autoremove ``` #### 1.3 安装更新管理 ```shell sudo apt-get install update-manager-core ``` #### 1.4 开始更新系统 ```shell sudo do-release-upgrade ``` > 运行以上命令可能会遇到的问题: > > - [ESM 401 Unauthorized error on Ubuntu 16.04](https://askubuntu.com/questions/1371293/esm-401-unauthorized-error-on-ubuntu-16-04) > - [将Ubuntu 16.04 LTS 升级到 18.04 LTS | 以及问题汇总](https://blog.csdn.net/undefinedefity/article/details/107001576) #### 1.5 更新完后重启系统 ### 2、升级后重启遇到的问题 #### 2.1 ssh 无法连接 > 无法使用 ssh 登录云服务器,但可以使用 VNC 方式登录服务器。 > > 登陆后,卸载重装 openssh-server,然后重启 ssh 服务 > > sudo apt remove --purge openssh-server > > sudo apt install openssh-server > > sudo systemctl restart ssh #### 2.2 访问个人网站 502 > 查看宝塔面板,可能是php出现问题,卸载重装即可 ------ Note:以上过程是从16.04升级到18.04,将以上步骤重复一遍即可升级到20.04 ### 3、参考资料 【1】[Ubuntu 16.04升级到Ubuntu 20.04教程](https://www.vpsgo.com/how-to-upgrade-ubuntu-16-04-to-ubuntu-20-04.html) 【2】[解决阿里云、腾讯云等升级ubuntu系统版本后ssh无法连接的问题](https://juejin.cn/post/6844903720992374797) 【3】[ESM 401 Unauthorized error on Ubuntu 16.04](https://askubuntu.com/questions/1371293/esm-401-unauthorized-error-on-ubuntu-16-04) 【4】[宝塔面板网站502 Bad Gateway无法正常打开的解决过程](https://www.vpsss.net/8602.html) 【5】[宝塔面板命令大全](https://www.bt.cn/btcode.html) 【6】[修复 "System has not been booted with systemd as init system "的错误](https://www.cnblogs.com/a5idc/p/13752839.html) Last modification:January 29th, 2022 at 11:48 pm © 允许规范转载