Package manager logs
Package installations, updates, and removals are logged by the server’s package manager.
View the logs
A server’s package manager logs can be viewed from within the ServerPilot dashboard or through SSH.
Log file location
The package manager log is located at:
/var/log/apt/history.log
Log file format
There are multiple lines in each log entry in the package manager logs. The format of each entry is:
Start-Date: START_DATECommandline: COMMANDInstall: PACKAGE:amd64 (INSTALL_VERSION), ...Upgrade: PACKAGE:amd64 (UPGRADE_OLD_VERSION, UPGRADE_NEW_VERSION), ...Remove: PACKAGE:amd64 (REMOVE_VERSION), ...End-Date: END_DATE
For each of the lines beginning with Install:
, Upgrade:
, and Remove:
,
the line will only be present if the operation was performed on at least one package.
The fields in each log entry are described in the following table.
Field | Description |
---|---|
START_DATE | The date and time when the package management operation began. |
COMMAND | The command that initiated the package management operation. |
PACKAGE | The name of a package that was installed, upgraded, or removed. |
INSTALL_VERSION | The version of a package that was installed. For a package installed as dependency of another package, the version will be followed by , automatic . |
UPGRADE_OLD_VERSION | The previous version of a package that was upgraded. |
UPGRADE_NEW_VERSION | The new version of a package that was upgraded. |
REMOVE_VERSION | The version of a package that was removed. |
END_DATE | The date and time when the package management operation ended. |
When the package manager is invoked multiple times such as during daily automated package updates, there will be multiple log entries produced.
The example below shows Linux kernel packages being updated during daily automated package updates.
Start-Date: 2025-03-06 06:28:47Commandline: /usr/bin/unattended-upgradeInstall: linux-modules-6.8.0-55-generic:amd64 (6.8.0-55.57, automatic), linux-image-6.8.0-55-generic:amd64 (6.8.0-55.57, automatic), linux-headers-6.8.0-55-generic:amd64 (6.8.0-55.57, automatic), linux-tools-6.8.0-55:amd64 (6.8.0-55.57, automatic), linux-tools-6.8.0-55-generic:amd64 (6.8.0-55.57, automatic), linux-headers-6.8.0-55:amd64 (6.8.0-55.57, automatic)Upgrade: linux-tools-common:amd64 (6.8.0-54.56, 6.8.0-55.57), linux-virtual:amd64 (6.8.0-54.56, 6.8.0-55.57), linux-headers-generic:amd64 (6.8.0-54.56, 6.8.0-55.57), linux-image-virtual:amd64 (6.8.0-54.56, 6.8.0-55.57), linux-headers-virtual:amd64 (6.8.0-54.56, 6.8.0-55.57), linux-libc-dev:amd64 (6.8.0-54.56, 6.8.0-55.57)End-Date: 2025-03-06 06:29:06
Start-Date: 2025-03-06 06:29:12Commandline: /usr/bin/unattended-upgradeRemove: linux-modules-6.8.0-54-generic:amd64 (6.8.0-54.56), linux-image-6.8.0-54-generic:amd64 (6.8.0-54.56)End-Date: 2025-03-06 06:29:14
Start-Date: 2025-03-06 06:29:18Commandline: /usr/bin/unattended-upgradeRemove: linux-tools-6.8.0-54:amd64 (6.8.0-54.56), linux-tools-6.8.0-54-generic:amd64 (6.8.0-54.56)End-Date: 2025-03-06 06:29:19
Start-Date: 2025-03-06 06:29:23Commandline: /usr/bin/unattended-upgradeRemove: linux-headers-6.8.0-54-generic:amd64 (6.8.0-54.56), linux-headers-6.8.0-54:amd64 (6.8.0-54.56)End-Date: 2025-03-06 06:29:25
Example commands
You must be logged in as root
to view the package manager logs.
View recent package manager log entries
Show the most recent 100 lines in the package manager log.
sudo tail -n 100 /var/log/apt/history.log