如何获得apt-get autoremove中包含的软件包列表

我知道我有一些软件包可以被删除,如果我运行apt-get autoremove ,但是我只是想知道它们是什么,而不删除它们。 我怎样才能列出什么将被删除而不删除它们? 或者,我怎样才能运行上面的命令,并强制它提示我?

autoremove函数列出要移除的软件包,并要求在实际执行操作之前允许继续。 如果你只是想看看会发生什么

您可以使用-s--simulate...开关来执行任何操作

-s,–simulate,–just-print,–dry-run,–recon,–no-act

  No action; perform a simulation of events that would occur but do not actually change the system. 

所以

 apt-get -s autoremove 

应该做你想做的。 有一个 – --assume-no开关,可以用来强迫no问任何问题

 apt-get autoremove --assume-no 

autoremove函数只能删除不再需要的包,所以你应该安全地运行它。

的autoremove

  autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.