我如何才能知道哪些软件包将会从 apt 中更新?

我如何才能知道哪些软件包将会从 apt 中更新?

我在登录时看到我的服务器上有几个可用的更新。

如何在不启动更新的情况下查看我的服务器上将更新哪些软件包?

答案1

使用--dry-run-s--simulate--just-print,参数--recon--no-act它实际上不会执行任何操作,它只会告诉您它会做什么:

来自 apt-get 手册页

-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. Configuration Item:
          APT::Get::Simulate.

          Simulate prints out a series of lines each one representing a dpkg
          operation, Configure (Conf), Remove (Remv), Unpack (Inst). Square
          brackets indicate broken packages with and empty set of square
          brackets meaning breaks that are of no consequence (rare).

因此可以轻松查看命令:

apt-get upgrade --dry-run

或者

apt-get upgrade -s

相关内容