ubuntu14.04 升级到 ubuntu16.04

参考:将Ubuntu 16.04 LTS 升级到 18.04 LTS | 以及问题汇总

# 升级前
(base) root@s215:~# cat /proc/version
Linux version 3.13.0-147-generic (buildd@lcy01-amd64-024) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4) ) #196-Ubuntu SMP Wed May 2 15:51:34 UTC 2018

# 升级后
(base) root@s215:~# cat /proc/version
Linux version 4.4.0-210-generic (buildd@lgw01-amd64-009) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ) #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021
# 升级命令
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt-get autoremove
sudo do-release-upgrade

出现的问题:

1、sudo apt udpate 出现错误。

a、把 /etc/apt/sources.list 中所有的 xxx.ubuntu.com/ubuntu 替换成 mirrors.aliyun.com/ubuntu。

b、把 http 改成 https。

c、把 /etc/apt/sources.list.d/ 目录下出错的相关文件删除。

# 

# deb cdrom:[Ubuntu-Server 14.04 LTS _Trusty Tahr_ - Release amd64 (20140416.2)]/ trusty main restricted

# deb cdrom:[Ubuntu-Server 14.04 LTS _Trusty Tahr_ - Release amd64 (20140416.2)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb https://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src https://mirrors.aliyun.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb https://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb https://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb https://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu xenial-security main restricted
deb-src https://mirrors.aliyun.com/ubuntu xenial-security main restricted
deb https://mirrors.aliyun.com/ubuntu xenial-security universe
deb-src https://mirrors.aliyun.com/ubuntu xenial-security universe
deb https://mirrors.aliyun.com/ubuntu xenial-security multiverse
deb-src https://mirrors.aliyun.com/ubuntu xenial-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu trusty partner
# deb-src http://archive.canonical.com/ubuntu trusty partner

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
# deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable # disabled on upgrade to xenial
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu trusty stable
# deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial stable # disabled on upgrade to xenial
# deb-src [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu trusty stable
# deb-src [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu trusty stable
(base) root@s215:~# ll /etc/apt/sources.list.d/
total 44
drwxr-xr-x 2 root root 4096 Jan 24 15:42 ./
drwxr-xr-x 7 root root 4096 Jan 24 15:51 ../
-rw-r--r-- 1 root root   79 Jan 24 14:53 docker.list
-rw-r--r-- 1 root root   45 Jan 24 14:53 docker.list.distUpgrade
-rw-r--r-- 1 root root   45 Jan 24 09:53 docker.list.save
-rw-r--r-- 1 root root  174 Jan 24 14:53 shimmerproject-ppa-trusty.list
-rw-r--r-- 1 root root  140 Jan 24 14:53 shimmerproject-ppa-trusty.list.distUpgrade
-rw-r--r-- 1 root root  140 Jan 24 09:53 shimmerproject-ppa-trusty.list.save
-rw-r--r-- 1 root root  295 Jan 24 14:53 ubuntu-esm-infra.list
-rw-r--r-- 1 root root  291 Jan 24 14:53 ubuntu-esm-infra.list.distUpgrade
-rw-r--r-- 1 root root  291 Jan 24 09:53 ubuntu-esm-infra.list.save

2、sudo do-release-upgrade 比较慢,中间还有需要确认的过程,比如

ubuntu14.04 升级到 ubuntu16.04_第1张图片 

你可能感兴趣的:(编程,ubuntu14.04,ubuntu16.04,sources.list)