i need a unattended upgrade config for reboot at 23:50 german time
- User
i need a unattended upgrade config for reboot at 23:50 german time
- Assistant
To set up an unattended upgrade configuration for rebooting at 23:50 German time, you can follow these steps:
- Open the unattended upgrade configuration file for editing. You can do this by running the following command in your terminal:
bashsudo nano /etc/apt/apt.conf.d/50unattended-upgrades- Add the following lines to the configuration file to specify the upgrade settings:
bashUnattended-Upgrade::Automatic-Reboot "true"; Unattended-Upgrade::Automatic-Reboot-Time "23:50";-
Save the configuration file by pressing Ctrl + X, then Y, and Enter.
-
To apply the changes, run the following command in the terminal:
bashsudo dpkg-reconfigure -plow unattended-upgradesThis configuration will ensure that unattended upgrades are applied and the system reboots at 23:50 German time.
- User
unattended upgrade does not install packages nor reboots the system. the dryrun works fine
- Assistant
I apologize for the confusion. If you want to schedule regular updates and reboots on your system, you can use a tool like
cronto achieve that. Here's a step-by-step guide on how to schedule unattended upgrades and reboot at a specific time usingcron:- Create a script to perform the update and reboot:
bashsudo nano /usr/local/bin/auto-update.sh- Add the following contents to the script:
bash#!/bin/bash apt-get update apt-get -y upgrade reboot-
Save and exit the editor by pressing Ctrl + X, then Y, and Enter.
-
Make the script executable:
bashsudo chmod +x /usr/local/bin/auto-update.sh- Edit the crontab:
bashcrontab -e- Add the following line to the crontab to schedule the update and reboot at 23:50 German time: