2022-09-11 14:08:46 +02:00
|
|
|
---
|
|
|
|
title: Unattended Upgrades
|
2022-11-19 15:25:20 +01:00
|
|
|
visible: true
|
2022-09-11 14:08:46 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
[toc]
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-09-11 14:08:46 +02:00
|
|
|
## Installation
|
2023-02-23 14:48:51 +01:00
|
|
|
|
|
|
|
`# apt install unattended-upgrades`
|
2022-09-11 14:08:46 +02:00
|
|
|
|
|
|
|
## Configuration
|
2023-02-23 14:48:51 +01:00
|
|
|
|
|
|
|
**NOTE: This configuration is tailored to my personal preferences. Feel free to do something else if you don't want what I'm doing**
|
2022-09-11 14:08:46 +02:00
|
|
|
|
|
|
|
### Enable automatic reboots
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-09-11 14:08:46 +02:00
|
|
|
If necessary, the server will automatically reboot.
|
2023-02-23 14:48:51 +01:00
|
|
|
An example would be kernel updates.
|
|
|
|
|
|
|
|
Edit `/etc/apt/apt.conf.d/50unattended-upgrades`
|
2022-09-11 14:08:46 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
...
|
|
|
|
Unattended-Upgrade::Automatic-Reboot "true";
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
|
|
|
### Repo update time
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-09-11 14:08:46 +02:00
|
|
|
Create an override file for `apt-daily.timer` using this command
|
2023-02-23 14:48:51 +01:00
|
|
|
`$ sudo systemctl edit apt-daily.timer`
|
2022-09-11 14:08:46 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Add these lines between the two comments
|
|
|
|
|
|
|
|
```systemd
|
2022-09-11 14:08:46 +02:00
|
|
|
[Timer]
|
|
|
|
OnCalendar=*-*-* 2:00
|
|
|
|
RandomizedDelaySec=0
|
|
|
|
```
|
|
|
|
|
|
|
|
### Host upgrade time
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-09-11 14:08:46 +02:00
|
|
|
Create an override file for `apt-daily-upgrade.timer` using this command
|
2023-02-23 14:48:51 +01:00
|
|
|
`$ sudo systemctl edit apt-daily-upgrade.timer`
|
2022-09-11 14:08:46 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Add these lines between the two comments
|
|
|
|
|
|
|
|
```systemd
|
2022-09-11 14:08:46 +02:00
|
|
|
[Timer]
|
|
|
|
OnCalendar=*-*-* 4:00
|
|
|
|
RandomizedDelaySec=0
|
|
|
|
```
|