$ cat /etc/apt/apt.conf.d/20auto-upgrades
cat: /etc/apt/apt.conf.d/20auto-upgrades: No such file or directory
$ tail /var/log/dpkg.log
(no output, empty file)
机器 2(启用无人值守升级):
$ cat /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
$ tail /var/log/dpkg.log
2017-06-07 18:35:38 status half-configured linux-generic:amd64 4.10.0.22.24
2017-06-07 18:35:38 status installed linux-generic:amd64 4.10.0.22.24
2017-06-07 18:35:38 configure linux-signed-image-generic:amd64 4.10.0.22.24 <none>
2017-06-07 18:35:38 status unpacked linux-signed-image-generic:amd64 4.10.0.22.24
2017-06-07 18:35:38 status half-configured linux-signed-image-generic:amd64 4.10.0.22.24
2017-06-07 18:35:38 status installed linux-signed-image-generic:amd64 4.10.0.22.24
2017-06-07 18:35:38 configure linux-signed-generic:amd64 4.10.0.22.24 <none>
2017-06-07 18:35:38 status unpacked linux-signed-generic:amd64 4.10.0.22.24
2017-06-07 18:35:38 status half-configured linux-signed-generic:amd64 4.10.0.22.24
2017-06-07 18:35:38 status installed linux-signed-generic:amd64 4.10.0.22.24
显示是否自动安装
这将向您展示自动安装的内容。默认情况下,它应该安装安全的。那里还有其他文件,具体取决于您正在运行的系统,所以可能要绕开它们。
可以在 中查找配置
/etc/apt/apt.conf.d/20auto-upgrades
。此外,您可以检查日志文件/var/log/dpkg.log
。如果无人值守升级正在运行,您应该会在那里看到最近发生的事件。让我们看两个示例会话:
机器 1(禁用无人值守升级):
机器 2(启用无人值守升级):
(机器 1 运行的是 Ubuntu 16.04,机器 2 运行的是 Ubuntu 17.04。不过,这应该没什么区别。)