sources.list 和 sources.list.distUpgrade 之间的区别

sources.list 和 sources.list.distUpgrade 之间的区别

在 ubuntu 中,/etc/apt/有两个文件:sources.listsources.list.distUpgrade。但我只知道它们是用来更新系统的。但它们之间有什么区别呢?顺便问一下,GPG 密钥是干什么用的?当我使用 ubuntu 源列表生成器更新 sources.list 时,我是否也应该更新 GPG 密钥?

谢谢 !

答案1

在发行版之间升级时,/etc/apt/sources.list.d 中的 .list 文件会被注释掉。这些文件的原始版本会使用 .distUpgrade 扩展名进行备份,这就是您所看到的。除了放在那儿作为备份之外,我认为 .distUpgrade 文件不会做任何事情。

我猜 Ubuntu(Debian?)之所以这么做,是因为它认为 .list 文件在各个发行版之间不兼容,但对于打包者来说,这非常不方便。像 google-chrome 这样的软件包会安装一个特殊的 cronjob 来解决这个问题,并在 dist 升级后取消注释它们的 .list 文件。

答案2

在终端中输入 man apt-get

 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. The dist-upgrade
       command may therefore 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.

相关内容