Ubuntu
如何判斷 apt-get upgrade 或 apt-get dist-upgrade 上次執行的時間
有沒有一種干淨的方法來檢測 apt-get upgrade 或 apt-get dist-upgrade 上次在 Ubuntu 伺服器上執行的時間?
如果預設情況下無法執行此操作,那麼修改腳本以跟踪上次執行 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, automatic), tk8.5-lib:amd64 (8.5.11-2ubuntu4, automatic), tcl8.5-lib:amd64 (8.5.13-1ubuntu4, automatic), libllvm3.3:amd64 (3.3-5ubuntu4, automatic), libgl1-mesa-dri:amd64 (9.2.1-1ubuntu3, automatic), libglapi-mesa:amd64 (9.2.1-1ubuntu3, automatic), libtxc-dxtn-s2tc0:amd64 (0~git20121227-1, automatic), libxv1:amd64 (1.0.9-1, automatic), libutempter0:amd64 (1.1.5-4build1, automatic), libxss1:amd64 (1.2.2-1, automatic), libxcb-glx0:amd64 (1.9.1-3ubuntu1, automatic), libgl1-mesa-glx:amd64 (9.2.1-1ubuntu3, automatic), libdrm-nouveau2:amd64 (2.4.46-1ubuntu1, automatic), libxcb-shape0:amd64 (1.9.1-3ubuntu1, automatic), blt:amd64 (2.4z-7, automatic), tk8.5:amd64 (8.5.11-2ubuntu4, automatic), tcl8.5:amd64 (8.5.13-1ubuntu4, automatic), xterm:amd64 (278-1ubuntu3, automatic), libxxf86vm1:amd64 (1.1.3-1, automatic), libelf1:amd64 (0.157-1ubuntu1, automatic), libxxf86dga1:amd64 (1.1.4-1, automatic), 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, 5.5.37-0ubuntu0.13.10.1), mysql-client-core-5.5:amd64 (5.5.35-0ubuntu0.13.10.2, 5.5.37-0ubuntu0.13.10.1), mysql-client-5.5:amd64 (5.5.35-0ubuntu0.13.10.2, 5.5.37-0ubuntu0.13.10.1), mysql-common:amd64 (5.5.35-0ubuntu0.13.10.2, 5.5.37-0ubuntu0.13.10.1), libmysqlclient18:amd64 (5.5.35-0ubuntu0.13.10.2, 5.5.37-0ubuntu0.13.10.1), python3-distupgrade:amd64 (0.205.5, 0.205.6), mysql-server:amd64 (5.5.35-0ubuntu0.13.10.2, 5.5.37-0ubuntu0.13.10.1), ubuntu-release-upgrader-core:amd64 (0.205.5, 0.205.6) End-Date: 2014-04-23 11:11:10