![如何查看 apt 會更新哪些軟體包?](https://rvso.com/image/1126790/%E5%A6%82%E4%BD%95%E6%9F%A5%E7%9C%8B%20apt%20%E6%9C%83%E6%9B%B4%E6%96%B0%E5%93%AA%E4%BA%9B%E8%BB%9F%E9%AB%94%E5%8C%85%EF%BC%9F.png)
我在登入時在我的伺服器上看到有一些可用更新。
如何在不啟動更新的情況下查看伺服器上將更新哪些軟體包?
答案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