导出apt包列表以供重用(debian)

是否可以从(Debian)服务器导出软件包列表,

所以我可以重复使用这个列表,只需点击apt-get install <exported_package_list>

在不同的服务器上?

我也可以pipe一个文本文件apt-getapt-get install << list.txt

查看dpkg--get-selections--set-selections选项。

您可以使用dpkg --get-selections > my-selections导出当前select列表。

为了恢复您首先需要运行dpkg --set-selections < my-selections ,然后apt-get dselect-upgrade以实际安装软件包的select。 请注意,这只会恢复已安装的软件包,而不会在安装过程中进行任何configuration或select。