How to configure automatic updates on Ubuntu 18.04 LTS
- 
 @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: Thank you for the how-to. 
 I am too spoiled on how to configure auto updates for Fedora and CentOS.yeah this is actually easier than fedora imo I don't know about that. I've done so many setups now that I script it. # Install dnf-automatic sudo dnf -y install dnf-automatic [email protected] [email protected] EMAILHOST=smtp.domain.com sudo sed -i "s|^email_to = root|email_to = ${EMAILTO}|" /etc/dnf/automatic.conf sudo sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/dnf/automatic.conf sudo sed -i 's|^emit_via = stdio|emit_via = email|' /etc/dnf/automatic.conf sudo sed -i "s|^email_from = [email protected]|email_from = ${EMAILFROM}|" /etc/dnf/automatic.conf sudo sed -i "s|^email_host = localhost|email_host = ${EMAILHOST}|" /etc/dnf/automatic.conf egrep '^email_to|^apply_updates|^emit_via|^email_from|^email_host' /etc/dnf/automatic.conf # Enable and Start dnf-automatic.timer sudo systemctl enable --now dnf-automatic.timerEdit: Missing the setting for the email_host
- 
 @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: Thank you for the how-to. 
 I am too spoiled on how to configure auto updates for Fedora and CentOS.yeah this is actually easier than fedora imo I don't know about that. I've done so many setups now that I script it. # Install dnf-automatic sudo dnf -y install dnf-automatic [email protected] [email protected] EMAILHOST=smtp.domain.com sudo sed -i "s|^email_to = root|email_to = ${EMAILTO}|" /etc/dnf/automatic.conf sudo sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/dnf/automatic.conf sudo sed -i 's|^emit_via = stdio|emit_via = email|' /etc/dnf/automatic.conf sudo sed -i "s|^email_from = [email protected]|email_from = ${EMAILFROM}|" /etc/dnf/automatic.conf # Enable and Start dnf-automatic.timer sudo systemctl enable --now dnf-automatic.timerIt's the same if any difference at all. Although unattended-upgrades should already be installed, so there's that  
- 
 @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: Thank you for the how-to. 
 I am too spoiled on how to configure auto updates for Fedora and CentOS.yeah this is actually easier than fedora imo I don't know about that. I've done so many setups now that I script it. # Install dnf-automatic sudo dnf -y install dnf-automatic [email protected] [email protected] EMAILHOST=smtp.domain.com sudo sed -i "s|^email_to = root|email_to = ${EMAILTO}|" /etc/dnf/automatic.conf sudo sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/dnf/automatic.conf sudo sed -i 's|^emit_via = stdio|emit_via = email|' /etc/dnf/automatic.conf sudo sed -i "s|^email_from = [email protected]|email_from = ${EMAILFROM}|" /etc/dnf/automatic.conf # Enable and Start dnf-automatic.timer sudo systemctl enable --now dnf-automatic.timerstealing this  
- 
 @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: Thank you for the how-to. 
 I am too spoiled on how to configure auto updates for Fedora and CentOS.yeah this is actually easier than fedora imo I don't know about that. I've done so many setups now that I script it. # Install dnf-automatic sudo dnf -y install dnf-automatic [email protected] [email protected] EMAILHOST=smtp.domain.com sudo sed -i "s|^email_to = root|email_to = ${EMAILTO}|" /etc/dnf/automatic.conf sudo sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/dnf/automatic.conf sudo sed -i 's|^emit_via = stdio|emit_via = email|' /etc/dnf/automatic.conf sudo sed -i "s|^email_from = [email protected]|email_from = ${EMAILFROM}|" /etc/dnf/automatic.conf # Enable and Start dnf-automatic.timer sudo systemctl enable --now dnf-automatic.timerIt's the same if any difference at all. Although unattended-upgrades should already be installed, so there's that  Maybe its Debian that doesn't have it included. 
- 
 Scripted a bit for anyone interested #*********************************************************** # Install postfix and Unattended Upgrades #*********************************************************** apt install -y unattended-upgrades apt install -y postfix #*********************************************************** # Edit Config file #*********************************************************** sed -i '/Unattended-Upgrade::Skip-Updates-On-Metered-Connections "true"/a\\Unattended-Upgrade::Mail "[email protected]"; ' /etc/apt/apt.conf.d/50unattended-upgrades sed -i '/Unattended-Upgrade::Skip-Updates-On-Metered-Connections "true"/a\\Unattended-Upgrade::Remove-Unused-Dependencies "true";' /etc/apt/apt.conf.d/50unattended-upgrades sed -i '/Unattended-Upgrade::Skip-Updates-On-Metered-Connections "true"/a\\ "${distro_id}:${distro_codename}-updates"; ' /etc/apt/apt.conf.d/50unattended-upgrades #*********************************************************** # Create additonal config file #*********************************************************** cat > /tmp/20auto-upgrades <<\EOF APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Download-Upgradeable-Packages "1"; APT::Periodic::AutocleanInterval "7"; APT::Periodic::Unattended-Upgrade "1"; EOF #*********************************************************** # Copy Config file #*********************************************************** cp /tmp/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades rm /tmp/20auto-upgrades #*********************************************************** # Enable and run Unattended-Upgrades #*********************************************************** systemctl enable unattended-upgrades apt update unattended-upgrades
- 
 @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: Thank you for the how-to. 
 I am too spoiled on how to configure auto updates for Fedora and CentOS.yeah this is actually easier than fedora imo I don't know about that. I've done so many setups now that I script it. # Install dnf-automatic sudo dnf -y install dnf-automatic [email protected] [email protected] EMAILHOST=smtp.domain.com sudo sed -i "s|^email_to = root|email_to = ${EMAILTO}|" /etc/dnf/automatic.conf sudo sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/dnf/automatic.conf sudo sed -i 's|^emit_via = stdio|emit_via = email|' /etc/dnf/automatic.conf sudo sed -i "s|^email_from = [email protected]|email_from = ${EMAILFROM}|" /etc/dnf/automatic.conf # Enable and Start dnf-automatic.timer sudo systemctl enable --now dnf-automatic.timerAre you installing postfix as well? 
- 
 @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: Thank you for the how-to. 
 I am too spoiled on how to configure auto updates for Fedora and CentOS.yeah this is actually easier than fedora imo I don't know about that. I've done so many setups now that I script it. # Install dnf-automatic sudo dnf -y install dnf-automatic [email protected] [email protected] EMAILHOST=smtp.domain.com sudo sed -i "s|^email_to = root|email_to = ${EMAILTO}|" /etc/dnf/automatic.conf sudo sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/dnf/automatic.conf sudo sed -i 's|^emit_via = stdio|emit_via = email|' /etc/dnf/automatic.conf sudo sed -i "s|^email_from = [email protected]|email_from = ${EMAILFROM}|" /etc/dnf/automatic.conf # Enable and Start dnf-automatic.timer sudo systemctl enable --now dnf-automatic.timerAre you installing postfix as well? No, but I do have a postfix relay server setup for that purpose. 
- 
 @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: Thank you for the how-to. 
 I am too spoiled on how to configure auto updates for Fedora and CentOS.yeah this is actually easier than fedora imo I don't know about that. I've done so many setups now that I script it. # Install dnf-automatic sudo dnf -y install dnf-automatic [email protected] [email protected] EMAILHOST=smtp.domain.com sudo sed -i "s|^email_to = root|email_to = ${EMAILTO}|" /etc/dnf/automatic.conf sudo sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/dnf/automatic.conf sudo sed -i 's|^emit_via = stdio|emit_via = email|' /etc/dnf/automatic.conf sudo sed -i "s|^email_from = [email protected]|email_from = ${EMAILFROM}|" /etc/dnf/automatic.conf # Enable and Start dnf-automatic.timer sudo systemctl enable --now dnf-automatic.timerAre you installing postfix as well? No, but I do have a postfix relay server setup for that purpose. Where do you configure that on the client? 
- 
 @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: @black3dynamite said in How to configure automatic updates on Ubuntu 18.04 LTS: Thank you for the how-to. 
 I am too spoiled on how to configure auto updates for Fedora and CentOS.yeah this is actually easier than fedora imo I don't know about that. I've done so many setups now that I script it. # Install dnf-automatic sudo dnf -y install dnf-automatic [email protected] [email protected] EMAILHOST=smtp.domain.com sudo sed -i "s|^email_to = root|email_to = ${EMAILTO}|" /etc/dnf/automatic.conf sudo sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/dnf/automatic.conf sudo sed -i 's|^emit_via = stdio|emit_via = email|' /etc/dnf/automatic.conf sudo sed -i "s|^email_from = [email protected]|email_from = ${EMAILFROM}|" /etc/dnf/automatic.conf # Enable and Start dnf-automatic.timer sudo systemctl enable --now dnf-automatic.timerAre you installing postfix as well? No, but I do have a postfix relay server setup for that purpose. Where do you configure that on the client? Looking over my post, I left out the email_hostsetting.
 You will enter the name, domain or IP address of the email host
  
- 
 @IRJ said in How to configure automatic updates on Ubuntu 18.04 LTS: Scripted a bit for anyone interested FWIW, this line didn't work for me -- sed -i '/Unattended-Upgrade::Skip-Updates-On-Metered-Connections "true"/a\\ "${distro_id}:${distro_codename}-updates"; ' /etc/apt/apt.conf.d/50unattended-upgradesI believe this is due to the line being inserted outside the Unattended-Upgrade::Allowed-Originsgrouping.


