如何将文件列表送入dpkg --get? [英] how can a feed a file list into dpkg --get?
问题描述
我可以使用 dpkg --get-selections | grep -v卸载|切-f 1 | tr'\ n'''> listpackages.txt
I can use dpkg --get-selections | grep -v deinstall | cut -f 1 | tr '\n' ' ' > listpackages.txt
使用我所有已安装的软件包填充文件.
to fill a file with all my installed packages.
是否可以使用dpkg或apt安装并引用上面创建的listpackages.txt文件?
Is there a to install using dpkg or apt and reference the listpackages.txt file created above?
我希望能够以软件包列表的形式备份已安装的内容,重新安装发行版,最后在一个命令中安装以前版本中安装的所有内容.
I want to be able to backup what I have installed as a package list, reinstall my distro and finally in one command install everything I had installed on the previous version.
-感谢u2!
推荐答案
使用--set-selections
标志执行此操作.
要从一个系统中导出软件包列表,请执行以下操作:dpkg --get-selections
,然后进行所需的任何过滤.
To export the package list from one system: dpkg --get-selections
followed by whatever filtering you want.
要将列表重新导入到另一个系统,请将其通过管道传输到dpkg --set-selections
,然后运行aptitude install
. dpkg --set-selections
命令将仅使安装过程排队;然后您实际上必须执行它.
To re-import the list to another system, pipe it into dpkg --set-selections
, and then run aptitude install
. The dpkg --set-selections
command will only queue the install process; you then actually have to execute it.
这篇关于如何将文件列表送入dpkg --get?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!