From 18.04 to Ubuntu 20.04.jpg

新代号 Focal Fossa

Focal Fossa

“Focal” 有“焦点”、“核心”之意。考虑到 Ubuntu 20.04 是 Ubuntu 的下一个长期支持版本,这是一个非常合适的名称,它将会在接下来成为 Canonical 软件产品组合的核心。“fossa” 则是一种生活在马达加斯加的“猫状、肉食性哺乳动物”,也是当地最大的肉食性哺乳动物。

从 18.04 升级 20.04

ubuntu 18.04 升级 20.04 仅需以下3个命令依次执行即可;

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

命令的区别

apt-get upgradeapt-get dist-upgrade 本质上是没有什么不同的。只不过,dist-upgrade 会识别出当依赖关系改变的情形并作出处理,而upgrade对此情形不处理。

apt-get upgrade 不会更改已安装的内容(仅适用于版本),apt-get dist-upgrade 将根据需要安装或删除软件包以完成升级,apt upgrade 将自动安装但不会删除软件包。apt full-upgrade执行与相同的功能apt-get dist-upgrade

​​​我通常使用以下方式升级计算机:

sudo apt-get update && time sudo apt-get dist-upgrade

以下是摘录man apt-get使用升级将遵循以下规则:在任何情况下,当前安装的软件包都不会删除,或者尚未安装的软件包都不会被检索和安装。如果那对您很重要,请使用apt-get upgrade。如果您希望事情“正常”,则可能要apt-get dist-upgrade确保解决依赖关系。

为了进一步说明为什么要升级而不是dist-upgrade,如果您是系统管理员,则需要可预测性。您可能正在使用高级固定功能,例如apt固定或从一组PPA(可能是内部PPA)中拉取,并且具有各种自动化功能来检查系统和可用的升级,而不是总是急于升级所有可用的软件包。当apt执行未描述的行为时,您会感到非常沮丧,特别是如果这会导致生产服务停机。

upgrade
    upgrade is used to install the newest versions of all packages
    currently installed on the system from the sources enumerated in
    /etc/apt/sources.list. Packages currently installed with new
    versions available are retrieved and upgraded; under no
    circumstances are currently installed packages removed, or packages
    not already installed retrieved and installed. New versions of
    currently installed packages that cannot be upgraded without
    changing the install status of another package will be left at
    their current version. An update must be performed first so that
    apt-get knows that new versions of packages are available.

dist-upgrade
    dist-upgrade in addition to performing the function of upgrade,
    also intelligently handles changing dependencies with new versions
    of packages; apt-get has a "smart" conflict resolution system, and
    it will attempt to upgrade the most important packages at the
    expense of less important ones if necessary. So, dist-upgrade
    command may remove some packages. The /etc/apt/sources.list file
    contains a list of locations from which to retrieve desired package
    files. See also apt_preferences(5) for a mechanism for overriding
    the general settings for individual packages.

via qastack.cn

FAQ

升级过程中可能会涉及到一些配置文件(/etc/)覆盖,注意赠别;

最后修改:2021 年 02 月 03 日 11 : 11 PM