Ubuntu从17.04升级到18.04

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. 

答案1

这在任何地方都没有得到正确的解释,这是你需要做的(或者我是如何做到的):

升级到 17.04 至 17.10: 无法从 ubuntu 17.04 升级到 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

(链接说使用 aptitude 而不是 apt-get)

从 17.10 升级到 18.04:停产升级

将 /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

当要求时按照它说的去做,然后等待它完成,你应该完成。

 

编辑

根据维曼蒂斯sudo sed -i -re 's/old-releases.ubuntu.com/archive.ubuntu.com/g' /etc/apt/sources.list不再需要。维曼蒂斯发了一篇关于它的帖子。相关部分:

# Upgrade from 17.04 to 17.10

# backup current sources file (just in case)
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

# change version codename from 'zesty' to 'artful'
sudo sed -i -re 's/zesty/artful/g' /etc/apt/sources.list

# 17.10 has reached it's end of life
# so we fetch from 'old-releases.ubuntu.com'
sudo sed -i -re 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

sudo apt update
sudo apt dist-upgrade
sudo apt autoremove

 

# Upgrade from 17.10 to 18.04 LTS

# change version codename from 'artful' to 'bionic'
sudo sed -i -re 's/artful/bionic/g' /etc/apt/sources.list

# 18.04 has NOT reached it's end of life yet (due in 2028)
# so we fetch from 'archive.ubuntu.com'
sudo sed -i -re 's/old-releases.ubuntu.com/archive.ubuntu.com/g' /etc/apt/sources.list

sudo apt update
sudo apt dist-upgrade
sudo apt autoremove

相关内容