“apt-get dselect-upgrade” 命令有什么作用?

“apt-get dselect-upgrade” 命令有什么作用?

运行该命令时,apt-get我获得了 apt-get 的所有可能选项和命令。但其中一个命令和定义我以前从未见过:

dselect-upgrade - Follow dselect selections

我运行了该命令sudo apt-get dselect-upgrade只是为了看看发生了什么,这是输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

那么这个命令到底起什么作用?它意味着什么Follow dselect sections

答案1

正如其他人指出的那样,它“遵循 dselect 的选择”。它的一个优点是,你可以将软件包选择列表提供给 dpkg:

dpkg --clear-selections
dpkg --set-selections < package_choice_list

然后执行“apt-get dselect-upgrade”,它将删除列表中没有的所有内容,并安装列表中的所有内容。我认为没有其他软件包工具可以做到这一点。它提供了一种确保“这些且只有这些”软件包被安装的方法,非常方便。

答案2

来源:man apt-get

dselect-upgrade
       dselect-upgrade is used in conjunction with the traditional Debian
       packaging front-end, dselect(1).  dselect-upgrade follows the
       changes made by dselect(1) to the Status field of available
       packages, and performs the actions necessary to realize that state
       (for instance, the removal of old and the installation of new
       packages).

所以你真正想问的是“什么是dselect?”,这曾经是一种利用 Debian 软件包功能来建议安装其他软件包的方法,当时恐龙还在地球上漫游。它现在仍然有效,甚至在它仍然被使用的地方也有自己的一席之地,但现在有更简单的方法来实现同样的事情。

对于初学者教程,看这里

答案3

我所知道的是,它dselect是用于备份我们的系统。

您还可以使用它在任何其他系统中安装相同的软件包。

dpkg --get-selection > packages.list这将在 packages.list 文件中创建系统中安装的所有软件包的列表。

现在,如果发生某些事情并且您的系统崩溃,您可以借助此packages.list文件安装系统中的所有软件包。

dpkg --set-selections < packages.list

sudo apt-get dselect-upgrade

这将为您完成这项工作。它将安装您系统之前的所有软件包。

如果您想在另一个系统上安装相同的软件包,请将此文件传输到该系统,然后运行这 2 个命令。它将为您解决问题。

相关内容