Linux Ubuntu 16.04 升级 18.04 详细教程

查看当前版本

lsb_release -a


升级到 Ubuntu 18.04

更新源和软件包到最新版

sudo apt update && sudo apt dist-upgrade && sudo apt autoremove

安装Ubuntu update manager

sudo apt install update-manager-core

查看update-manager配置文件

vi /etc/update-manager/release-upgrades

确保设置为Prompt=lts如果不是就修改为Prompt=lts


输入命令开始升级

sudo do-release-upgrade
或者
sudo do-release-upgrade -d

注意:开始升级前请确保重要文件已经备份,以免出现无法挽回的损失;

升级详细过程

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]
#是否继续在 SSH 下运行?
#输入 y 继续
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]
#在端口"1022"启动
#输入 回车 确认继续
Do you want to start the upgrade? 

2 installed packages are no longer supported by Canonical. You can 
still get support from the community. 

77 new packages are going to be installed. 257 packages are going to 
be upgraded. 

You have to download a total of 216 M. This download will take about 
42 seconds with your connection. 

Installing the upgrade can take several hours. Once the download has 
finished, the process cannot be canceled. 

 Continue [yN]  Details [d]
#是否要启动升级?
#输入 y 继续


选择keep the local version currently installed选项
#保持当前安装的本地版本
说明:键盘上下键选择需要的选项,右键切换到OK选项,回车确认


选择keep the local version currently installed选项
#保持当前安装的本地版本
说明:键盘上下键选择需要的选项,右键切换到OK选项,回车确认

Remove obsolete packages? 

23 packages are going to be removed. 

Continue [yN]  Details [d]
#是否删除过时的软件包?
#输入 y 继续
System upgrade is complete.

Restart required 

To finish the upgrade, a restart is required. 
If you select 'y' the system will be restarted. 

Continue [yN]
#系统升级已完成,需要重新启动
#输入 y 开始重启启动

重启完成后输入lsb_release -a查看是否已经升级到Ubuntu 18.04


发表评论