wiki-grav/pages/02.linux/unattended-upgrades/default.en.md

54 lines
990 B
Markdown
Raw Normal View History

2022-09-11 14:08:46 +02:00
---
title: Unattended Upgrades
visible: true
2022-09-11 14:08:46 +02:00
---
[toc]
2022-09-11 14:08:46 +02:00
## Installation
`# apt install unattended-upgrades`
2022-09-11 14:08:46 +02:00
## Configuration
**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
2022-09-11 14:08:46 +02:00
If necessary, the server will automatically reboot.
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
2022-09-11 14:08:46 +02:00
Create an override file for `apt-daily.timer` using this command
`$ sudo systemctl edit apt-daily.timer`
2022-09-11 14:08:46 +02: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
2022-09-11 14:08:46 +02:00
Create an override file for `apt-daily-upgrade.timer` using this command
`$ sudo systemctl edit apt-daily-upgrade.timer`
2022-09-11 14:08:46 +02:00
Add these lines between the two comments
```systemd
2022-09-11 14:08:46 +02:00
[Timer]
OnCalendar=*-*-* 4:00
RandomizedDelaySec=0
```