是否有一种干净的方法来检测上次在ubuntu服务器上运行apt-get upgrade或apt-get dist-upgrade的时间?
如果默认情况下无法执行此操作,那么修改脚本以便跟踪apt-get upgrade或apt-get dist-upgrade最后一次运行的最佳位置.
您正在搜索的日志文件是:/var/log/apt/history.log
这是2个日志条目:
Start-Date: 2014-04-15 14:15:35 Commandline: apt-get install python3-tk Install: libxcb-dri2-0:amd64 (1.9.1-3ubuntu1,automatic),x11-utils:amd64 (7.7+1,tk8.5-lib:amd64 (8.5.11-2ubuntu4,tcl8.5-lib:amd64 (8.5.13-1ubuntu4,libllvm3.3:amd64 (3.3-5ubuntu4,libgl1-mesa-dri:amd64 (9.2.1-1ubuntu3,libglapi-mesa:amd64 (9.2.1-1ubuntu3,libtxc-dxtn-s2tc0:amd64 (0~git20121227-1,libxv1:amd64 (1.0.9-1,libutempter0:amd64 (1.1.5-4build1,libxss1:amd64 (1.2.2-1,libxcb-glx0:amd64 (1.9.1-3ubuntu1,libgl1-mesa-glx:amd64 (9.2.1-1ubuntu3,libdrm-nouveau2:amd64 (2.4.46-1ubuntu1,libxcb-shape0:amd64 (1.9.1-3ubuntu1,blt:amd64 (2.4z-7,tk8.5:amd64 (8.5.11-2ubuntu4,tcl8.5:amd64 (8.5.13-1ubuntu4,xterm:amd64 (278-1ubuntu3,libxxf86vm1:amd64 (1.1.3-1,libelf1:amd64 (0.157-1ubuntu1,libxxf86dga1:amd64 (1.1.4-1,python3-tk:amd64 (3.3.1-0ubuntu2) End-Date: 2014-04-15 14:15:44 Start-Date: 2014-04-23 11:10:37 Commandline: apt-get dist-upgrade Upgrade: MysqL-server-core-5.5:amd64 (5.5.35-0ubuntu0.13.10.2,5.5.37-0ubuntu0.13.10.1),MysqL-server-5.5:amd64 (5.5.35-0ubuntu0.13.10.2,MysqL-client-core-5.5:amd64 (5.5.35-0ubuntu0.13.10.2,MysqL-client-5.5:amd64 (5.5.35-0ubuntu0.13.10.2,MysqL-common:amd64 (5.5.35-0ubuntu0.13.10.2,libMysqLclient18:amd64 (5.5.35-0ubuntu0.13.10.2,python3-distupgrade:amd64 (0.205.5,0.205.6),MysqL-server:amd64 (5.5.35-0ubuntu0.13.10.2,ubuntu-release-upgrader-core:amd64 (0.205.5,0.205.6) End-Date: 2014-04-23 11:11:10