4
为什么使用cron自动化时apt-get失败?
我正在尝试使用cron自动执行系统更新。您可以在下面查看我的crontab,命令和产生的错误。 当我以root用户身份运行upgrades.sh时,脚本运行良好。当cron运行它时,apt-get -y update没有问题,但是aptitude -y safe-upgrade失败了。我猜是这个错误:debconf: (This frontend requires a controlling tty.)是因为有一个内核更新,而内核更新又更新了grub,这需要我明确地说可以覆盖/boot/grub/menu.lst。但是我不明白路径错误。我想要不需要我监督的更新。 我已经阅读了这个问题,它是尚不可接受的解决方案unattended-upgrades,我可能最终会使用它,但是为什么不能使用cron?似乎它应该非常简单,并且更加Linuxy。 Crontab root@daedalus:~/bin# crontab -l # m h dom mon dow command 45 06 * * * ~/bin/upgrades.sh upgrades.sh root@daedalus:~/bin# cat upgrades.sh #!/bin/bash /usr/bin/apt-get -y update /usr/bin/aptitude -y safe-upgrade 失误 debconf: unable to initialize frontend: Dialog debconf: (TERM …