如何获取apt-get autoremove中存在的软件包列表

Luc*_*one 6 apt

我知道我有一些包准备在运行时被删除apt-get autoremove,但我只想知道它们是哪些,而不是删除它们。如何在不删除它们的情况下列出将要删除的内容?或者,如何运行上述命令并强制它提示我?

use*_*517 9

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.
Run Code Online (Sandbox Code Playgroud)

所以

apt-get -s autoremove 
Run Code Online (Sandbox Code Playgroud)

应该做你想做的。有一个--assume-no开关可以用来强制no回答任何问题,例如

apt-get autoremove --assume-no
Run Code Online (Sandbox Code Playgroud)

autoremove功能仅删除不再需要的包,因此无论如何您都应该安全地运行它。

自动删除

       autoremove is used to remove packages that were automatically
       installed to satisfy dependencies for other packages and are now no
       longer needed.
Run Code Online (Sandbox Code Playgroud)