阿里云ECS Ubuntu 14.04升级到Ubuntu 16.0

在阿里云有一台服务器,是Ubuntu 14.04版本,这个版本太旧了,各种的包不支持,如 php7.0, mysql 5.7+ 等等,所以,只能升级到Ubuntu 16.0,另外官方是不建议升级的,自己需要升级,做好重要配置及数据的备份。

一、备份原软件源文件sourcelist

cp /etc/apt/sources.list /etc/apt/sources.list.bak

二、修改软件源文件

vim   /etc/apt/sources.list

改为如下源:

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

三、升级

更新系统软件包 :apt update && apt dist-upgrade

重启:reboot

安装更新工具:apt install update-manager-core

使用ssh登录服务器升级,建议使用screen,防止SSH连接断开。 

安装screen,启动screen,升级Ubuntu:

$ sudo apt-get install screen
$ screen
$ sudo do-release-upgrade -d

你可能感兴趣的:(阿里云ecs,ubuntu14.04,ubuntu16.04)