如果我编辑sources.list并在Ubuntu版本之间跳转会出现任何问题吗?

Err*_*404 11 apt software-sources do-release-upgrade

我发现sources.listin/etc/apt是所有存储库的密钥文件。

我还发现每个系统和ubuntu版本都有自己的sources.list,所以这就是我有点实验的心情!

我当时使用的是Ubuntu 18.04 LTS(64 位),只是浏览并查看不同的sources.list文件。其中我发现了一些有趣的事情。所以,截至目前,有很多新的ubuntu版本刚刚发布。我也愿意将我的升级到21.04 (因为 gnome 40)

所以我发现我可以通过命令升级ubuntusudo do-release-upgrade但是该命令会转到下一个版本,而不是最新版本。所以这是非常耗时和消耗互联网的​​(我没有 20GB 的互联网)

我发现的唯一方法是从 ISO 重新安装,但我不想刷新所有数据或包,因为它们也需要一点时间来安装。

所以我所做的有点 愚蠢,我将我的内容更改sources.list为-

#deb cdrom:[Ubuntu 21.04 _Hirsute Hippo_ - Release amd64 (20210420)]/ hirsute main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-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 http://us.archive.ubuntu.com/ubuntu/ hirsute universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute universe
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-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 http://us.archive.ubuntu.com/ubuntu/ hirsute multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-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 http://us.archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe 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 hirsute partner
# deb-src http://archive.canonical.com/ubuntu hirsute partner

deb http://security.ubuntu.com/ubuntu hirsute-security main restricted
# deb-src http://security.ubuntu.com/ubuntu hirsute-security main restricted
deb http://security.ubuntu.com/ubuntu hirsute-security universe
# deb-src http://security.ubuntu.com/ubuntu hirsute-security universe
deb http://security.ubuntu.com/ubuntu hirsute-security multiverse
# deb-src http://security.ubuntu.com/ubuntu hirsute-security multiverse

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
Run Code Online (Sandbox Code Playgroud)

来源

然后我跑了

sudo apt update && sudo apt full-upgrade && sudo apt dist-upgrade
Run Code Online (Sandbox Code Playgroud)

然后我的系统和一切都更改为21.04

那么这可能是一个有点大的大脑?

这会损害我的系统吗?有一些好处吗?会出现什么问题?

  • 我的所有软件包都已升级并安装了新软件包。

  • 我的系统是最新的

  • 我只是想知道这是否有害或会造成不良后果。

  • 说实话,升级只需要1804Mb,所以轻了很多。

  • 到目前为止(使用了两个小时)没有任何问题。

use*_*733 23

恭喜,您已经发现了在 Debian 版本之间迁移的原始 Debian 方法:编辑源代码,然后运行dist-upgrade​​.

Ubuntu方法在底层do-release-upgrade使用,但还包括大多数用户可以欣赏的一些附加功能:dist-upgrade

  • 标准化的新sources.list,以及该文件的自动编辑。
  • 禁用 PPA 以防止升级失败。
  • 新软件包安装后自动删除。
  • 需要时进行脚本化迁移。
  • 快速刷新
  • 预发布期间,志愿者反复测试和调试常见的升级路径

这可能有害或者可能做坏事吗?

当然。如果您使用一组不明智的新源,您很容易就会破坏您的系统。

Apt 是一个伟大而优雅的工具,但它并不智能。它会尝试完全按照你的命令去做,无论这个命令有多么愚蠢。

很有可能使用 dist-upgrade 在版本之间运行未经测试的路径 - 例如从 20.04 到 21.10。阿普会做到的。但它没有经过测试。也许效果会很好;也许不会。您可能会遇到其他人无法重现的意外问题。我们没有测试它(这就是“未经测试”的意思)。你正在测试它。

一般来说,调试由未经测试的发行版升级引起的严重故障是浪费每个人的时间——某些路径已经过测试和支持;离开那些标记的道路,你就只能靠自己了。只需重新安装所需版本的 Ubuntu 即可更快、更轻松。如果您在安装过程中注意的话,您可以在保留数据的同时覆盖 Ubuntu。

如果一群分布式升级爱好者想要聚在一起调试额外的升级路径并提供支持,我们欢迎他们。当前的系统由志愿者测试人员的数量和可用的开发人员时间决定。


gui*_*erc 9

是的,它可以工作,但也可能失败。Ubuntu 不是 Debian,并且具有用于发布升级系统的工具(并确保更高的成功机会)。

我在这个盒子上使用开发版本(即当前jammy);通常会在之前的开发版本发布后 30 小时左右(或者当需要的档案已设置好,并且一些关键包已准备好时)进行碰撞。如果尚未设置(这种情况很常见),我会按照您所做的操作来碰撞此框。当然,我在做之前会做一些检查;因此,您的成功率可能取决于您执行的检查(其中许多检查和更多检查[例如,确保软件包以正确的顺序升级]是通过&完成的)。base-filesdo-release-upgrade -ddo-release-upgradeupgrade-manager

您还可以重新安装而不会丢失任何数据文件,并让重新安装自动添加回您的附加软件包(即那些标记为手动安装的软件包);当我参与 QA 测试时,我会定期这样做,并使用重新安装用于支持目的的盒子(也是我自己的一些盒子),因为它升级了我的系统并通过 QA 测试安装进行安装。(通过重新安装升级也会向后退,但可以做一些功课以确保没有数据问题)。例如。当groovy或 20.10 达到 EOL 时;我刚刚做了一个顽皮的QA 测试安装来安装我的 21.10 支持盒(快速安装实现了 2 倍的do-release-upgrade步骤;我没有丢失任何音乐,我选择的音乐播放器(默认安装时未安装)等.并且只用了所需时间的一小部分,并且还完成了 QA 测试)。安装不需要具有破坏性——但这并不意味着您不应该进行备份;很容易犯错误。

仅供参考:如果盒子是开发版本(不包括我的主电脑);我实际上并没有升级这些系统,而是通过重新安装进行升级,这样我就可以在升级我的软件包的同时取消 QA 测试。目前的开发版本是jammyfocus(即下一个20.04.4发布)。最近几个月,我还进行了从21.04impish /21.10 到20.04.321.10的盒子切换。有些路径无法通过release-upgrade实现,也无法修改源!我没有丢失任何音乐,也没有丢失任何手动安装的软件包 (使用第 3 方软件包时,体验可能会有所不同;在 QA 盒子上,我避免使用第 3 方软件包

  • 这个细节只是简单地触及了这个问题(*这是我的评论稍微清理了*);但主要解决了OP评论“*我发现的唯一方法是从ISO重新安装,但我不想刷新所有数据或包,因为它们也需要一点时间来安装*”,我不同意...... -install 选项是我对 Ubuntu 的**喜爱** :) (2认同)
  • “通常会在之前的开发版本发布后大约 30 小时左右进行自我碰撞”——您可以将您的sources.list 中的动物名称替换为“./devel”,以运行永久测试版并假装 Ubuntu 是 Debian Sid。最好的事情是它还可以与 Launchpad PPA 一起使用 - 它别名为该特定存储库上的最新可用(稳定或开发)版本。 (2认同)