当前位置: 首页>>技术教程>>正文


Ubuntu从17.04升级到18.04

,

问题描述

我已经安装了Ubuntu 17.04,并且想将其升级到18.04。当我尝试做时:

 sudo do-release-upgrade

我收到一条消息,说An upgrade from 'zesty' to 'bionic' is not supported with this tool。需要输入以继续进行此操作。

sudo do-release-upgrade
Checking for a new Ubuntu release
Your Ubuntu release is not supported anymore.
For upgrade information, please visit:
http://www.ubuntu.com/releaseendoflife

Get:1 Upgrade tool signature [819 B]                                           
Get:2 Upgrade tool [1,257 kB]                                                  
Fetched 1,258 kB in 0s (0 B/s)                                                 
authenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg' 
extracting 'bionic.tar.gz'

Reading cache

Checking package manager

Can not upgrade 

An upgrade from 'zesty' to 'bionic' is not supported with this tool. 

最佳方案

这在任何地方都没有正确解释,这是您需要执行的操作(或我的操作方式):

升级到17.04至17.10:Unable to upgrade from ubuntu 17.04 to 17.10

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #to be safe
sudo sed -i -re 's/old-releases.ubuntu.com/archive.ubuntu.com/g' /etc/apt/sources.list
sudo sed -i -re 's/zesty/artful/g' /etc/apt/sources.list
sudo apt update
sudo apt dist-upgrade
sudo apt autoremove

(链接说使用智能来代替apt-get)

从17.10升级到18.04:EOLUpgrades

将/etc/apt/sources.list中的所有内容替换为:

## EOL upgrade sources.list
# Required
deb http://old-releases.ubuntu.com/ubuntu/ artful main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ artful-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ artful-security main restricted universe multiverse

# Optional
#deb http://old-releases.ubuntu.com/ubuntu/ artful-backports main restricted universe multiverse

然后运行升级:

apt-get update
apt-get dist-upgrade
do-release-upgrade

按照要求执行操作,等待操作完成,您应该完成操作。

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/9594.html,未经允许,请勿转载。