apt-get更新/升级列表,不做任何改动

Modified on: Thu, 12 Sep 2019 23:20:02 +0800

我想查看哪些软件包可用于更新/升级而不实际更改任何文件,因为有些软件包我不想更新。那么是否可以通过例外来获得更新。

最佳答案

从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.

       Simulation run as user will deactivate locking (Debug::NoLocking)
       automatic. Also a notice will be displayed indicating that this
       is only a simulation, if the option APT::Get::Show-User-Simulation-Note
       is set (Default: true). Neither NoLocking nor the notice will be
       triggered if run as root (root should know what he is doing without
       further warnings by apt-get).

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

所以请确保apt-get -s upgrade

如果要升级某些软件包,只需apt-get install <package name>,如果已经安装,它将更新它。然而,它还必须更新所有依赖项,并且根据它们的不同,可以级联到许多更新中。

如果我在软件包更新方面落后,我会对一些大的(也许是php,apache2等)进行apt-get install,这样我就可以保留它们了检查任何问题,然后在我完成后apt-get upgrade


相关问答

添加新评论