无法使用do-release-upgrade方法从disco 19.04升级到focal 20.04,因为已经过了终止支持期。

此时,我无法从Disco 19.04升级到Focal 20.04。我已经阅读了几个最新的问题,这些问题已经关闭,并参考了一些非常旧的问题。我已经阅读了所有8年前的帖子,并按照那些指示进行了操作。它们确实有帮助,但不能解决我的问题。在我输入这段文字时,我已经阅读了所有建议给我的问题。请不要关闭我的帖子并参考那些旧的帖子,因为它们不能解决这个问题,这是一个新问题(也就是说,自从那些问题被回答以来已经过去了8年,它们没有解决我的问题)。
在排除故障并将“archive”替换为“old-releases”,并从源列表中删除所有第三方软件包后,我可以执行“apt update”和“apt upgrade”,系统已经是最新的。
我尝试了“full-upgrade”,“dist-upgrade”和其他我能想到的方法。现在所有的命令都显示:
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我已经使用所有其他线程中的建议修复了我收到的所有错误消息。

当我运行“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 [1,554 B]
Get:2 Upgrade tool [1,337 kB]
Fetched 1,338 kB in 0s (0 B/s)
authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
extracting 'focal.tar.gz'
Reading cache
Checking package manager
Can not upgrade 
An upgrade from 'disco' to 'focal' is not supported with this tool.

当我使用软件升级图形工具时,我会得到以下内容:
Can not upgrade: An upgrade from 'disco' to 'focal' is not supported with this tool.

这台电脑有很多用户和许多已安装的软件,我无法进行全新安装。首先,我不知道如何在保存所有用户、文件和程序的同时进行安装,其次,我预见到一个灾难性的情况,即电脑崩溃导致所有数据丢失。
如果我可以从19.04升级到19.10,我一直无法弄清楚如何操作。我相当确定这是不可能的,因为19.04已经不再受支持。
如果有关系的话,我的磁盘是加密的。
请,请,请有人告诉我有没有办法从19.04升级到20.04而不需要全新安装,同时保存所有用户、数据和程序!如果因为错过了更新截止日期而无法升级,我会感到非常震惊。如果不行,我将被迫购买一台新电脑!

个人而言,我会选择重新安装,非破坏性的(即使用相同的分区,不格式化分区),它将记录您的软件包,删除系统目录,安装,添加回您的其他软件包并要求重新启动。这种方法非常出色,比桌面版的发行升级快得多,但对于服务器可能有缺点(可以在系统目录中存储配置文件;桌面应用程序将文件存储在$HOME中,因此不会被触及)。当然,首先备份,并且如果您不喜欢每6-9个月升级一次,则使用LTS,就像@user535733所说的那样。 - guiverc
14那些8-9岁的帖子没有回答我的问题。我知道您不能或不应该跳过版本,但我也无法升级到19.10。我正在寻找替代方案的建议。当我安装了19.04并错过了自动升级的截止日期时,我并没有意识到这会使升级变得不可能。否则,我肯定不会错过截止日期。如果错过开发版本的截止日期会导致这个问题,我希望更清楚一些。对于新用户来说不是很友好。我想我将不得不学习如何备份和还原,并进行全新安装。 - KingWm
1我成功地修改了在这个链接上找到的指示,从19.04升级到19.10:https://tips.graphica.com.au/upgrading-from-retired-ubuntu-releases/ - Jonathan Berger
1@JonathanBerger 我们已经有了一个类似的问答(https://askubuntu.com/q/1208109/816190)。它被认为是一个非常活跃的问答,最高票答案至少帮助了200人(考虑到可见和不可见的投票),我还为那个优秀的答案颁发了赏金。很遗憾这个问题没有被关闭为重复。你是否想建议对上述问题进行编辑,以便像你说的那样,谷歌用户可以受益?顺便说一下,感谢你的关注。非常感激! - Kulfy
Stalinko的回答似乎是最好的一个 - 直接下载并调用dist-upgrade工具。 - Ant6n
首先,通过将以下行添加到sources.list文件来更新到eoan版本: Ubuntu将选择距离您最近的镜像 -> 下载速度更快 deb mirror://mirrors.ubuntu.com/mirrors.txt eoan main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt eoan-updates main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt eoan-backports main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt eoan-security main restricted universe multiverse然后执行以下命令进行更新: sudo apt update sudo apt dist-upgrade现在应该很容易更新到focal版本了。 - arnonuem
@JonathanBerger能否请您友好地将您的评论扩展并添加为这个问题的答案?谢谢。 - jokerdino
@jokerdino 抱歉,我已经忘记了我所采取的步骤,我不想提供不准确的信息。对于这篇帖子解锁花费了这么长时间,我也感到非常沮丧。 - Jonathan Berger
这个回答解决了你的问题吗?如何使用命令行从18.10升级到19.10? - Braiam
3个回答

这是唯一帮助我解决问题的指引:升级即将终止支持的 Ubuntu 版本 Ubuntu 19.04

引用自上述链接:

~# nano /etc/apt/sources.list

I got stuck trying to update php 7.2 to 7.4 because my Digital Ocean server was on an older version of Ubuntu.

If I tried to update my release I'd get the following

# 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

Please install all available updates for your release before upgrading.

When attempting to update my packages with apt-get update I would get these types of errors.

Err:5 http://mirrors.digitalocean.com/ubuntu disco Release
  404  Not Found [IP: 172.67.168.253 80

E: The repository 'http://mirrors.digitalocean.com/ubuntu disco Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

These occur because my Ubuntu version is not only out of date but at its end of life so updating Ubuntu to a newer version.will require me to update my repositories.

Digital Ocean uses its own mirrors for repositories so there is a little more work there in figuring out which ones to use.

What version of Ubuntu am I on?

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.04
Release:        19.04
Codename:       disco

What repositories are being used?

~# nano /etc/apt/sources.list

Example repoistory on Digital Ocean Ubuntu 19.04

deb http://mirrors.digitalocean.com/ubuntu/ disco main restricted

Let's first get our current Ubuntu version up to date

To make the server update the files, we had to edit the /etc/apt/sources.list with working repository locations.

To goal here, on this Digital Ocean server is to update the urls they use for the repositories with ones you that will have the files you need for your update

We want to replace this urls

mirrors.digitalocean.com

with

old-releases.ubuntu.com

This command will work

sudo sed -i -e 's/mirrors.digitalocean.com/old-releases.ubuntu.com/g'

/etc/apt/sources.list

Now

sudo apt-get update

will work!

Let's keep going

sudo apt-get upgrade -y
sudo apt-get dist-upgrade

Try to upgrade Ubuntu on the command line.

We are still unable to upgrade via do-release-upgrade

# do-release-upgrade

Checking package manager

Can not upgrade

An upgrade from 'disco' to 'focal' is not supported with this tool.

Frack!

So now I have my current outdated version of Ubuntu up to date, but I can't upgrade to the next version using do-release-upgrade

You can try to upgrade manually.

First go to https://changelogs.ubuntu.com/meta-release and scroll down to the release you want to upgrade to.

For example if you want to upgrade to Ubuntu 19.10 Eoan scroll to you find the url to the UpgradeTool

UpgradeTool: http://old-releases.ubuntu.com/ubuntu/dists/eoan-updates/main/dist-upgrader-all/current/eoan.tar.gz

Now pull this over to a directory on your server

wget http://old-releases.ubuntu.com/ubuntu/dists/eoan-updates/main/dist-upgrader-all/current/eoan.tar.gz
mkdir eoan_upgrade
tar -xvzf  eoan.tar.gz -C eoan_upgrade

cd eoan_upgrade

Run the upgrade script

sudo ./eoan
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

1上述的升级脚本对我来说不起作用。我尝试了使用wget和tar命令,但都没有成功,所以有解决办法吗? - Ubuntu-user_bear
wget和tar有什么确切的问题?它们是否会报错? - Stalinko
你的帖子提到要升级到20,但示例中你却在升级到19.10。是有什么原因吗?在升级到20.04之前必须先升级到19.10吗? - GSUgambit
1没关系,我看到了最后一个命令,你要升级到19.10,因为它是受支持的,然后再进行一次发行版升级到20。 - GSUgambit
@Stalinko 我猜你的问题是你没有在存档中将它更改为"old-releases",而是复制并粘贴了他链接到的meta-release网站上的那个。 - GSUgambit
1请将 sudo apt dist-upgrade 替换为 do-release-upgrade。 - GSUgambit
1然后使用sudo do-release-upgrade命令升级到Ubuntu 20.x.x版本。 - Sai

面对生命周期结束后的同样问题。升级到20.04的过程首先是升级到19.10。以下是我将19.04升级到19.10的步骤:
1. 打开 `/etc/apt/sources.list` 文件 2. 删除所有内容,并用以下内容替换(为了安全起见,你可能想要备份一下)
deb http://old-releases.ubuntu.com/ubuntu eoan main 
deb http://old-releases.ubuntu.com/ubuntu eoan-updates main 
deb http://old-releases.ubuntu.com/ubuntu eoan-security main 

最后,只需逐个运行这些命令即可:
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

那就是基本上这样。Ubuntu现在应该已经升级到19.10(Eoan)了。
现在从Eoan升级到Focal(20.04)是一项简单的任务。
如@xiaojueguan所建议的,运行以下命令从Eoan升级到Focal:
do-release-upgrade

注意:在更新到Eoan之后,您可能需要更新您的sources.list文件。您可以在此处找到它:
Eoan(Ubuntu 19.10):https://gist.github.com/malikalichsan/860b8134a74c65a394efe09711d0b95f Focal(Ubuntu 20.04):https://gist.github.com/ishad0w/788555191c7037e249a439542c53e170

这不是"官方"的升级方式,但可能会起作用。 - Artur Meinild
是的,这完全不是官方的。但据我了解,在支持终止之后,并没有任何官方的方法。尽管如此,我发现这是最简单的方法了 :) - Prasannjeet Singh
你的解决方案对我有一部分起作用。 重要的亮点。进行中间更新 disco=>eoan=>focal <br> - Hillsie
是的,如果你看第一行,它说的是从19.04(disco)升级到19.10(eoan)。 - Prasannjeet Singh
1当您升级到19.10(eoan)时,请键入“do-release-upgrade”,并按照教程操作,即可完成升级。 - xiaojueguan

摘要:

进行中间升级 disco=>eoan=>focal


备用升级

  1. 我尝试了@misteeque的解决方案的一部分,并将所有的/etc/apt/sources.list更改为old-release。所以,无法确定这是否对下面的步骤产生了影响。我也执行了http://security...的操作。如果不需要0.,请留言。
  2. sudo wget http://old-releases.ubuntu.com/ubuntu/dists/eoan-updates/main/dist-upgrader-all/current/eoan.tar.gz
  3. sudo mkdir eoan_upgrade && sudo mkdir eoan_upgrade
  4. cd eoan_upgrade
  5. sudo ./eoan
  6. sudo do-release-upgrade并再次执行5.以达到focal

lsb_release -a有助于检查升级前后的情况。


1为了后代,我使用这种方法成功地完成了disco -> eoan -> focal -> jimmy的转换。虽然花费了相当多的时间,但最终还是成功了。 - hezamu