我正在尝试创建一个脚本,以便在关机时更新我的 Ubuntu 安装。
要升级我的系统,我使用以下命令:
unbuffer apt-get full-upgrade -y --allow-downgrades --show-progress 2>&1 > /var/log/ubuntu-automatic-update/update_status.txt
但是执行的时候日志显示如下:
Package lists are read... 0%
Package lists are read... 100%
Package lists are read... Done
Dependency tree is built... 0%
Building dependency tree... 0%
Building dependency tree... 50%
Building dependency tree... 50%
Dependency tree is built... Done
Status information is read in... 0%
Status information is read in... 0%
Status information is read in... Done
0 updated, 0 reinstalled, 0 to remove and 168 not updated.
但在终端中手动运行完全相同的命令会更新所有内容。不过,它告诉我将新安装 5 个软件包。
能否以某种方式修复此问题并使其无论如何都更新?
编辑:完整的脚本可以在这里找到:https://github.com/TobiPeterG/ubuntu_automatic_updates/edit/main/files/shutdown_update 也许我在那里犯了一个错误?