我正在运行 12.04 LTS ubuntu 服务器。而且我认为如果可以在更新可用时通知我会很好。但是我不知道怎么知道...
我试过查看apt-get
手册页。从它我能够使用apt-get -s upgrade
在脚本中获取 apt-get 输出而不会阻止问题。
现在,我清楚地看到了差异:
更新可用:
apt-get -s upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
dpkg dpkg-dev libdpkg-perl
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst dpkg [1.16.1.2ubuntu7.2] (1.16.1.2ubuntu7.3 Ubuntu:12.04/precise-updates [amd64])
Conf dpkg (1.16.1.2ubuntu7.3 Ubuntu:12.04/precise-updates [amd64])
Inst dpkg-dev [1.16.1.2ubuntu7.2] (1.16.1.2ubuntu7.3 Ubuntu:12.04/precise-updates [all]) []
Inst libdpkg-perl [1.16.1.2ubuntu7.2] (1.16.1.2ubuntu7.3 Ubuntu:12.04/precise-updates [all])
Conf libdpkg-perl (1.16.1.2ubuntu7.3 Ubuntu:12.04/precise-updates [all]) …
Run Code Online (Sandbox Code Playgroud)